Skip to content

Commit 2954f2f

Browse files
committed
convert classes to records in tests, remove unneeded datatype modifiers on channels
issue spring-projects#3501
1 parent 0eb4d2d commit 2954f2f

File tree

1 file changed

+4
-68
lines changed

1 file changed

+4
-68
lines changed

spring-integration-graphql/src/test/java/org/springframework/integration/graphql/outbound/GraphQlMessageHandlerTests.java

+4-68
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,12 @@ GraphQlMessageHandler handler(GraphQlService graphQlService) {
304304
return new GraphQlMessageHandler(graphQlService);
305305
}
306306

307-
// @artem
308307
@Bean
309308
IntegrationFlow graphqlQueryMessageHandlerFlow(GraphQlMessageHandler handler) {
310309

311-
return IntegrationFlows.from(MessageChannels.flux("inputChannel").datatype(Object.class, RequestInput.class))
310+
return IntegrationFlows.from(MessageChannels.flux("inputChannel"))
312311
.handle(handler)
313-
.channel(c -> c.flux("resultChannel").datatype(RequestOutput.class))
312+
.channel(c -> c.flux("resultChannel"))
314313
.get();
315314
}
316315

@@ -354,71 +353,8 @@ AnnotatedControllerConfigurer annotatedDataFetcherConfigurer() {
354353

355354
}
356355

357-
static class QueryResult {
356+
record QueryResult(String id) {}
358357

359-
private final String id;
360-
361-
QueryResult(final String id) {
362-
this.id = id;
363-
}
364-
365-
String getId() {
366-
return this.id;
367-
}
368-
369-
@Override
370-
public boolean equals(Object o) {
371-
if (this == o) {
372-
return true;
373-
}
374-
if (!(o instanceof QueryResult)) {
375-
return false;
376-
}
377-
QueryResult that = (QueryResult) o;
378-
return getId().equals(that.getId());
379-
}
380-
381-
@Override
382-
public int hashCode() {
383-
return Objects.hash(getId());
384-
}
385-
386-
@Override
387-
public String toString() {
388-
return "QueryResult{" +
389-
"id='" + id + '\'' +
390-
'}';
391-
}
392-
}
393-
394-
static class Update {
395-
396-
private final String id;
397-
398-
Update(final String id) {
399-
this.id = id;
400-
}
401-
402-
String getId() {
403-
return this.id;
404-
}
405-
406-
@Override
407-
public boolean equals(Object o) {
408-
if (this == o) {
409-
return true;
410-
}
411-
if (!(o instanceof Update)) {
412-
return false;
413-
}
414-
Update update = (Update) o;
415-
return getId().equals(update.getId());
416-
}
417-
418-
@Override
419-
public int hashCode() {
420-
return Objects.hash(getId());
421-
}
422-
}
358+
record Update(String id) {}
423359

424360
}

0 commit comments

Comments
 (0)