Skip to content

Commit e129c47

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

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
@@ -198,6 +198,7 @@ void generate_CustomAnnotationMappings_Multiple() throws Exception {
198198
@Test
199199
void generate_ResolverArgumentAnnotations() throws Exception {
200200
mappingConfig.setGenerateDataFetchingEnvironmentArgumentInApis(true);
201+
mappingConfig.setGenerateParameterizedFieldsResolvers(true);
201202
mappingConfig.setResolverArgumentAnnotations(singleton(
202203
"@org.springframework.graphql.data.method.annotation.Argument"));
203204

@@ -210,6 +211,9 @@ void generate_ResolverArgumentAnnotations() throws Exception {
210211
assertSameTrimmedContent(
211212
new File("src/test/resources/expected-classes/annotation/QueryResolver_ArgumentAnnotations.java.txt"),
212213
getFileByName(files, "QueryResolver.java"));
214+
assertSameTrimmedContent(new File("src/test/resources/expected-classes/annotation/" +
215+
"EventPropertyResolver_ArgumentAnnotations.java.txt"),
216+
getFileByName(files, "EventPropertyResolver.java"));
213217
}
214218

215219
@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)