Skip to content

Commit cbc426c

Browse files
Add resolver argument annotation test assertion
Signed-off-by: Clément BUCHART <[email protected]>
1 parent 0c3674b commit cbc426c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/test/java/com/kobylynskyi/graphql/codegen/GraphQLCodegenAnnotationsTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ void generate_CustomAnnotationMappings_Multiple() throws Exception {
200200
@Test
201201
void generate_ResolverArgumentAnnotations() throws Exception {
202202
mappingConfig.setGenerateDataFetchingEnvironmentArgumentInApis(true);
203+
mappingConfig.setGenerateParameterizedFieldsResolvers(true);
203204
mappingConfig.setResolverArgumentAnnotations(singleton(
204205
"@org.springframework.graphql.data.method.annotation.Argument"));
205206

@@ -212,6 +213,9 @@ void generate_ResolverArgumentAnnotations() throws Exception {
212213
assertSameTrimmedContent(
213214
new File("src/test/resources/expected-classes/annotation/QueryResolver_ArgumentAnnotations.java.txt"),
214215
getFileByName(files, "QueryResolver.java"));
216+
assertSameTrimmedContent(new File("src/test/resources/expected-classes/annotation/" +
217+
"EventPropertyResolver_ArgumentAnnotations.java.txt"),
218+
getFileByName(files, "EventPropertyResolver.java"));
215219
}
216220

217221
@Test
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.kobylynskyi.graphql.test1;
2+
3+
4+
/**
5+
* Resolver for EventProperty
6+
*/
7+
@javax.annotation.Generated(
8+
value = "com.kobylynskyi.graphql.codegen.GraphQLCodegen",
9+
date = "2020-12-31T23:59:59-0500"
10+
)
11+
public interface EventPropertyResolver {
12+
13+
/**
14+
* Properties
15+
*/
16+
java.util.List<EventProperty> child(EventProperty eventProperty, Integer first, Integer last, graphql.schema.DataFetchingEnvironment env) throws Exception;
17+
18+
/**
19+
* Parent event of the property
20+
*/
21+
Event parent(EventProperty eventProperty, EventStatus withStatus, String createdAfter, graphql.schema.DataFetchingEnvironment env) throws Exception;
22+
23+
}

0 commit comments

Comments
 (0)