diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51d9e491..55e9f135 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,12 +3,11 @@ name: Build -on: [push] +on: [push, pull_request] jobs: build: runs-on: ubuntu-latest - environment: prod steps: - uses: actions/checkout@v2 - name: Set up JDK 8 @@ -20,8 +19,6 @@ jobs: run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build - - name: Test with Gradle - run: ./gradlew test - name: Publish Test Report uses: mikepenz/action-junit-report@v2 if: always() # always run even if the previous step fails diff --git a/README.md b/README.md index 4cc4c17c..a37b826c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ If you would like to use a tool that creates a graphql spring boot server using ```groovy dependencies { - compile "io.github.graphql-java:graphql-java-annotations:8.5" + compile "io.github.graphql-java:graphql-java-annotations:9.0" } ``` @@ -47,7 +47,7 @@ dependencies { io.github.graphql-java graphql-java-annotations - 8.5 + 9.0 ``` diff --git a/build.gradle b/build.gradle index 6d05adea..caaef010 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,9 @@ gradle.projectsEvaluated { dependencies { compile 'javax.validation:validation-api:1.1.0.Final' - compile 'com.graphql-java:graphql-java:16.2' + compile 'com.graphql-java:graphql-java:17.1' + compile 'com.graphql-java:graphql-java-extended-scalars:17.0' + // OSGi compileOnly 'org.osgi:org.osgi.core:6.0.0' diff --git a/gradle.properties b/gradle.properties index 103bfc28..a7c04cdc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ org.gradle.daemon=true org.gradle.parallel=true org.gradle.jvmargs=-Dfile.encoding=UTF-8 -version = 8.5 +version = 9.0 diff --git a/src/main/java/graphql/annotations/annotationTypes/GraphQLBatched.java b/src/main/java/graphql/annotations/annotationTypes/GraphQLBatched.java deleted file mode 100644 index e3c20fdf..00000000 --- a/src/main/java/graphql/annotations/annotationTypes/GraphQLBatched.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright 2016 Yurii Rashkovskii - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - */ -package graphql.annotations.annotationTypes; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target({ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface GraphQLBatched { -} diff --git a/src/main/java/graphql/annotations/dataFetchers/BatchedMethodDataFetcher.java b/src/main/java/graphql/annotations/dataFetchers/BatchedMethodDataFetcher.java deleted file mode 100644 index 5f4c3a89..00000000 --- a/src/main/java/graphql/annotations/dataFetchers/BatchedMethodDataFetcher.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright 2016 Yurii Rashkovskii - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - */ -package graphql.annotations.dataFetchers; - -import graphql.annotations.processor.ProcessingElementsContainer; -import graphql.annotations.processor.typeFunctions.TypeFunction; -import graphql.execution.batched.Batched; -import graphql.schema.DataFetchingEnvironment; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - -public class BatchedMethodDataFetcher extends MethodDataFetcher { - - - public BatchedMethodDataFetcher(Method method, TypeFunction typeFunction, ProcessingElementsContainer container) { - super(method,typeFunction, container); - if (!Modifier.isStatic(method.getModifiers())) { - throw new IllegalArgumentException("Batched method should be static"); - } - } - - @Batched - @Override - public Object get(DataFetchingEnvironment environment) { - return super.get(environment); - } -} diff --git a/src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java b/src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java index 7ba39f7d..5a756662 100644 --- a/src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java +++ b/src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java @@ -12,7 +12,6 @@ */ package graphql.annotations.dataFetchers; -import graphql.annotations.annotationTypes.GraphQLBatched; import graphql.annotations.annotationTypes.GraphQLConstructor; import graphql.annotations.annotationTypes.GraphQLInvokeDetached; import graphql.annotations.annotationTypes.GraphQLName; @@ -69,7 +68,7 @@ public T get(DataFetchingEnvironment environment) { T obj; if (Modifier.isStatic(method.getModifiers())) { return (T) method.invoke(null, invocationArgs(environment, container)); - } else if (method.isAnnotationPresent(GraphQLBatched.class) || method.isAnnotationPresent(GraphQLInvokeDetached.class)) { + } else if (method.isAnnotationPresent(GraphQLInvokeDetached.class)) { obj = newInstance((Class) method.getDeclaringClass()); } else if (!method.getDeclaringClass().isInstance(environment.getSource())) { obj = newInstance((Class) method.getDeclaringClass(), environment.getSource()); diff --git a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilder.java b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilder.java index 1f94f6a3..0082f5f5 100644 --- a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilder.java +++ b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilder.java @@ -97,7 +97,7 @@ private GraphQLDirective transformArgs(GraphQLDirective graphQLDirective, Annota for (int i = annotation.annotationType().getDeclaredMethods().length; i < arguments.size(); i++) { int finalI = i; - directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getDefaultValue()))); + directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getArgumentDefaultValue().getValue()))); } return directiveBuilder.build(); } @@ -118,7 +118,7 @@ private GraphQLDirective transformArgs(GraphQLDirective graphQLDirective, String for (int i = argumentValues.length; i < arguments.size(); i++) { int finalI = i; - directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getDefaultValue()))); + directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getArgumentDefaultValue().getValue()))); } return directiveBuilder.build(); } diff --git a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java index 348266f1..ee40d9fb 100644 --- a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java +++ b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java @@ -14,11 +14,9 @@ */ package graphql.annotations.processor.retrievers.fieldBuilders.method; -import graphql.annotations.annotationTypes.GraphQLBatched; import graphql.annotations.annotationTypes.GraphQLDataFetcher; import graphql.annotations.annotationTypes.GraphQLRelayMutation; import graphql.annotations.connection.GraphQLConnection; -import graphql.annotations.dataFetchers.BatchedMethodDataFetcher; import graphql.annotations.dataFetchers.MethodDataFetcher; import graphql.annotations.dataFetchers.RelayMutationMethodDataFetcher; import graphql.annotations.processor.ProcessingElementsContainer; @@ -62,9 +60,7 @@ public MethodDataFetcherBuilder(Method method, GraphQLOutputType outputType, Typ public DataFetcher build() { GraphQLDataFetcher dataFetcher = method.getAnnotation(GraphQLDataFetcher.class); DataFetcher actualDataFetcher; - if (dataFetcher == null && method.getAnnotation(GraphQLBatched.class) != null) { - actualDataFetcher = new BatchedMethodDataFetcher(method, typeFunction, container); - } else if (dataFetcher == null) { + if (dataFetcher == null) { actualDataFetcher = new MethodDataFetcher(method, typeFunction, container); } else { actualDataFetcher = dataFetcherConstructor.constructDataFetcher(method.getName(), dataFetcher); diff --git a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodTypeBuilder.java b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodTypeBuilder.java index ebdae92f..b81cf599 100644 --- a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodTypeBuilder.java +++ b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodTypeBuilder.java @@ -14,10 +14,8 @@ */ package graphql.annotations.processor.retrievers.fieldBuilders.method; -import graphql.annotations.annotationTypes.GraphQLBatched; import graphql.annotations.processor.ProcessingElementsContainer; import graphql.annotations.processor.retrievers.fieldBuilders.Builder; -import graphql.annotations.processor.typeFunctions.BatchedTypeFunction; import graphql.annotations.processor.typeFunctions.TypeFunction; import graphql.schema.GraphQLOutputType; import graphql.schema.GraphQLType; @@ -42,14 +40,7 @@ public MethodTypeBuilder(Method method, TypeFunction typeFunction, ProcessingEle public GraphQLType build() { AnnotatedType annotatedReturnType = method.getAnnotatedReturnType(); - TypeFunction typeFunction; - if (method.getAnnotation(GraphQLBatched.class) != null) { - typeFunction = new BatchedTypeFunction(this.typeFunction); - } else { - typeFunction = this.typeFunction; - } - - return typeFunction.buildType(isInput,method.getReturnType(), annotatedReturnType, container); + return this.typeFunction.buildType(isInput,method.getReturnType(), annotatedReturnType, container); } } diff --git a/src/main/java/graphql/annotations/processor/typeFunctions/BatchedTypeFunction.java b/src/main/java/graphql/annotations/processor/typeFunctions/BatchedTypeFunction.java deleted file mode 100644 index 2733de72..00000000 --- a/src/main/java/graphql/annotations/processor/typeFunctions/BatchedTypeFunction.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright 2016 Yurii Rashkovskii - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - */ -package graphql.annotations.processor.typeFunctions; - -import graphql.annotations.processor.ProcessingElementsContainer; -import graphql.schema.GraphQLType; - -import java.lang.reflect.AnnotatedParameterizedType; -import java.lang.reflect.AnnotatedType; -import java.lang.reflect.ParameterizedType; -import java.util.List; - -public class BatchedTypeFunction implements TypeFunction { - private TypeFunction defaultTypeFunction; - - public BatchedTypeFunction(TypeFunction defaultTypeFunction) { - this.defaultTypeFunction = defaultTypeFunction; - } - - @Override - public String getTypeName(Class aClass, AnnotatedType annotatedType) { - return defaultTypeFunction.getTypeName(aClass, annotatedType); - } - - @Override - public boolean canBuildType(final Class aClass, final AnnotatedType type) { - return defaultTypeFunction.canBuildType(aClass, type); - } - - @Override - public GraphQLType buildType(boolean input, Class aClass, AnnotatedType annotatedType, ProcessingElementsContainer container) { - if (!aClass.isAssignableFrom(List.class)) { - throw new IllegalArgumentException("Batched method should return a List"); - } - if (!(annotatedType instanceof AnnotatedParameterizedType)) { - throw new IllegalArgumentException("Batched should return parameterized type"); - } - AnnotatedParameterizedType parameterizedType = (AnnotatedParameterizedType) annotatedType; - AnnotatedType arg = parameterizedType.getAnnotatedActualTypeArguments()[0]; - Class klass; - if (arg.getType() instanceof ParameterizedType) { - klass = (Class) ((ParameterizedType) (arg.getType())).getRawType(); - } else { - klass = (Class) arg.getType(); - } - return defaultTypeFunction.buildType(input, klass, arg,container); - } -} diff --git a/src/main/java/graphql/annotations/processor/typeFunctions/BigDecimalFunction.java b/src/main/java/graphql/annotations/processor/typeFunctions/BigDecimalFunction.java index e5e3f730..87ff183e 100644 --- a/src/main/java/graphql/annotations/processor/typeFunctions/BigDecimalFunction.java +++ b/src/main/java/graphql/annotations/processor/typeFunctions/BigDecimalFunction.java @@ -14,17 +14,16 @@ */ package graphql.annotations.processor.typeFunctions; -import graphql.Scalars; import graphql.annotations.processor.ProcessingElementsContainer; +import graphql.scalars.ExtendedScalars; import graphql.schema.GraphQLType; - import java.lang.reflect.AnnotatedType; import java.math.BigDecimal; public class BigDecimalFunction implements TypeFunction { @Override public String getTypeName(Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLBigDecimal.getName(); + return ExtendedScalars.GraphQLBigDecimal.getName(); } @Override @@ -38,6 +37,6 @@ public GraphQLType buildType(boolean input, Class aClass, AnnotatedType annot } private GraphQLType buildType(boolean inputType, Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLBigDecimal; + return ExtendedScalars.GraphQLBigDecimal; } } diff --git a/src/main/java/graphql/annotations/processor/typeFunctions/BigIntegerFunction.java b/src/main/java/graphql/annotations/processor/typeFunctions/BigIntegerFunction.java index 34cc2d11..73ffb37a 100644 --- a/src/main/java/graphql/annotations/processor/typeFunctions/BigIntegerFunction.java +++ b/src/main/java/graphql/annotations/processor/typeFunctions/BigIntegerFunction.java @@ -14,17 +14,16 @@ */ package graphql.annotations.processor.typeFunctions; -import graphql.Scalars; import graphql.annotations.processor.ProcessingElementsContainer; +import graphql.scalars.ExtendedScalars; import graphql.schema.GraphQLType; - import java.lang.reflect.AnnotatedType; import java.math.BigInteger; public class BigIntegerFunction implements TypeFunction { @Override public String getTypeName(Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLBigInteger.getName(); + return ExtendedScalars.GraphQLBigInteger.getName(); } @Override @@ -38,6 +37,6 @@ public GraphQLType buildType(boolean input, Class aClass, AnnotatedType annot } private GraphQLType buildType(boolean inputType, Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLBigInteger; + return ExtendedScalars.GraphQLBigInteger; } } diff --git a/src/main/java/graphql/annotations/processor/typeFunctions/ByteFunction.java b/src/main/java/graphql/annotations/processor/typeFunctions/ByteFunction.java index 2a58473f..1eecd33a 100644 --- a/src/main/java/graphql/annotations/processor/typeFunctions/ByteFunction.java +++ b/src/main/java/graphql/annotations/processor/typeFunctions/ByteFunction.java @@ -14,16 +14,15 @@ */ package graphql.annotations.processor.typeFunctions; -import graphql.Scalars; import graphql.annotations.processor.ProcessingElementsContainer; +import graphql.scalars.ExtendedScalars; import graphql.schema.GraphQLType; - import java.lang.reflect.AnnotatedType; public class ByteFunction implements TypeFunction { @Override public String getTypeName(Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLByte.getName(); + return ExtendedScalars.GraphQLByte.getName(); } @Override @@ -37,6 +36,6 @@ public GraphQLType buildType(boolean input, Class aClass, AnnotatedType annot } private GraphQLType buildType(boolean inputType, Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLByte; + return ExtendedScalars.GraphQLByte; } } diff --git a/src/main/java/graphql/annotations/processor/typeFunctions/CharFunction.java b/src/main/java/graphql/annotations/processor/typeFunctions/CharFunction.java index ba2ebb1c..664521e2 100644 --- a/src/main/java/graphql/annotations/processor/typeFunctions/CharFunction.java +++ b/src/main/java/graphql/annotations/processor/typeFunctions/CharFunction.java @@ -14,17 +14,16 @@ */ package graphql.annotations.processor.typeFunctions; -import graphql.Scalars; import graphql.annotations.processor.ProcessingElementsContainer; +import graphql.scalars.ExtendedScalars; import graphql.schema.GraphQLType; - import java.lang.reflect.AnnotatedType; public class CharFunction implements TypeFunction { @Override public String getTypeName(Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLChar.getName(); + return ExtendedScalars.GraphQLChar.getName(); } @Override @@ -38,6 +37,6 @@ public GraphQLType buildType(boolean input, Class aClass, AnnotatedType annot } private GraphQLType buildType(boolean inputType, Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLChar; + return ExtendedScalars.GraphQLChar; } } diff --git a/src/main/java/graphql/annotations/processor/typeFunctions/LongFunction.java b/src/main/java/graphql/annotations/processor/typeFunctions/LongFunction.java index 06618c46..ed92f6f4 100644 --- a/src/main/java/graphql/annotations/processor/typeFunctions/LongFunction.java +++ b/src/main/java/graphql/annotations/processor/typeFunctions/LongFunction.java @@ -14,10 +14,9 @@ */ package graphql.annotations.processor.typeFunctions; -import graphql.Scalars; import graphql.annotations.processor.ProcessingElementsContainer; +import graphql.scalars.ExtendedScalars; import graphql.schema.GraphQLType; - import java.lang.reflect.AnnotatedType; @@ -25,7 +24,7 @@ class LongFunction implements TypeFunction { @Override public String getTypeName(Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLLong.getName(); + return ExtendedScalars.GraphQLLong.getName(); } @Override @@ -39,7 +38,7 @@ public GraphQLType buildType(boolean input, Class aClass, AnnotatedType annot } private GraphQLType buildType(boolean inputType, Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLLong; + return ExtendedScalars.GraphQLLong; } } diff --git a/src/main/java/graphql/annotations/processor/typeFunctions/ShortFunction.java b/src/main/java/graphql/annotations/processor/typeFunctions/ShortFunction.java index 9f608c64..4582c631 100644 --- a/src/main/java/graphql/annotations/processor/typeFunctions/ShortFunction.java +++ b/src/main/java/graphql/annotations/processor/typeFunctions/ShortFunction.java @@ -14,16 +14,15 @@ */ package graphql.annotations.processor.typeFunctions; -import graphql.Scalars; import graphql.annotations.processor.ProcessingElementsContainer; +import graphql.scalars.ExtendedScalars; import graphql.schema.GraphQLType; - import java.lang.reflect.AnnotatedType; public class ShortFunction implements TypeFunction { @Override public String getTypeName(Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLShort.getName(); + return ExtendedScalars.GraphQLShort.getName(); } @Override @@ -37,7 +36,7 @@ public GraphQLType buildType(boolean input, Class aClass, AnnotatedType annot } private GraphQLType buildType(boolean inputType, Class aClass, AnnotatedType annotatedType) { - return Scalars.GraphQLShort; + return ExtendedScalars.GraphQLShort; } } diff --git a/src/test/java/graphql/annotations/GraphQLBatchedTest.java b/src/test/java/graphql/annotations/GraphQLBatchedTest.java deleted file mode 100644 index 213b6f18..00000000 --- a/src/test/java/graphql/annotations/GraphQLBatchedTest.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Copyright 2016 Yurii Rashkovskii - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - */ -package graphql.annotations; - -import graphql.ExceptionWhileDataFetching; -import graphql.ExecutionResult; -import graphql.GraphQL; -import graphql.annotations.annotationTypes.GraphQLBatched; -import graphql.annotations.annotationTypes.GraphQLField; -import graphql.annotations.processor.GraphQLAnnotations; -import graphql.execution.batched.BatchedExecutionStrategy; -import graphql.schema.GraphQLObjectType; -import graphql.schema.GraphQLSchema; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import static graphql.Scalars.GraphQLString; -import static graphql.annotations.AnnotationsSchemaCreator.newAnnotationsSchema; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -@SuppressWarnings("unchecked") -public class GraphQLBatchedTest { - - private GraphQLAnnotations graphQLAnnotations; - - @BeforeMethod - public void init() { - this.graphQLAnnotations = new GraphQLAnnotations(); - } - - public static class SimpleBatchedField { - @GraphQLField - @GraphQLBatched - public static List a() { - return Arrays.asList("one", "two"); - } - } - - public static class TestBatchedObject { - @GraphQLField - public List fields() { - return Arrays.asList(new SimpleBatchedField(), new SimpleBatchedField()); - } - } - - @Test - public void batchedDataFetcher() throws Throwable { - GraphQLObjectType nestedObject = this.graphQLAnnotations.object(SimpleBatchedField.class); - assertEquals(nestedObject.getFieldDefinition("a").getType(), GraphQLString); - - GraphQLSchema schema = newAnnotationsSchema().query(TestBatchedObject.class).build(); - GraphQL graphql = GraphQL.newGraphQL(schema).queryExecutionStrategy(new BatchedExecutionStrategy()).build(); - ExecutionResult result = graphql.execute("{ fields { a } }", new TestBatchedObject()); - List errors = result.getErrors(); - for (Object e : errors) { - throw ((ExceptionWhileDataFetching) e).getException(); - } - assertTrue(result.getErrors().isEmpty()); - Map data = (Map) result.getData(); - List> fields = (List) data.get("fields"); - assertEquals(fields.get(0).get("a"), "one"); - assertEquals(fields.get(1).get("a"), "two"); - } - - public static class NoStaticBatchedField { - @GraphQLField - @GraphQLBatched - public List a() { - return Arrays.asList("one", "two"); - } - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void noStaticField() { - GraphQLObjectType object = this.graphQLAnnotations.object(NoStaticBatchedField.class); - } - - public static class NoListBatchedField { - @GraphQLField - @GraphQLBatched - public String a() { - return "one"; - } - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void noListField() { - GraphQLObjectType object = this.graphQLAnnotations.object(NoStaticBatchedField.class); - } - - public static class NoParameterizedBatchedField { - @GraphQLField - @GraphQLBatched - public List a() { - return Arrays.asList("one", "two"); - } - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void noParameterizedReturnField() { - GraphQLObjectType object = this.graphQLAnnotations.object(NoStaticBatchedField.class); - } -} diff --git a/src/test/java/graphql/annotations/GraphQLDirectiveCreationTest.java b/src/test/java/graphql/annotations/GraphQLDirectiveCreationTest.java index e00acbb0..027b6d97 100644 --- a/src/test/java/graphql/annotations/GraphQLDirectiveCreationTest.java +++ b/src/test/java/graphql/annotations/GraphQLDirectiveCreationTest.java @@ -81,17 +81,17 @@ public void directive_suppliedDirectiveClass_returnCorrectDirective() { assertNotNull(isActive); assertEquals(isActive.getName(), "isActive"); assertEquals(isActive.getType(), GraphQLBoolean); - assertEquals(isActive.getDefaultValue(), true); + assertEquals(isActive.getArgumentDefaultValue().getValue(), true); GraphQLArgument suffixToAdd = directive.getArgument("suffixToAdd"); assertNotNull(suffixToAdd); assertEquals(suffixToAdd.getType(), GraphQLString); assertEquals(suffixToAdd.getDescription(), "adds suffix to the string"); - assertEquals(suffixToAdd.getDefaultValue(), ""); + assertEquals(suffixToAdd.getArgumentDefaultValue().getValue(), ""); GraphQLArgument noDefaultValue = directive.getArgument("noDefaultValue"); assertNotNull(noDefaultValue); - assertNull(noDefaultValue.getDefaultValue()); + assertNull(noDefaultValue.getArgumentDefaultValue().getValue()); } /** @@ -137,13 +137,13 @@ public void directive_suppliedDirectiveMethodContainer_returnCorrectDirective() assertNotNull(isActive); assertEquals(isActive.getName(), "isActive"); assertEquals(isActive.getType(), GraphQLBoolean); - assertNull(isActive.getDefaultValue()); + assertNull(isActive.getArgumentDefaultValue().getValue()); GraphQLArgument suffixToAdd = suffix.getArgument("suffix"); assertNotNull(suffixToAdd); assertEquals(suffixToAdd.getType(), GraphQLString); assertEquals("the suffix", suffixToAdd.getDescription()); - assertNull(suffixToAdd.getDefaultValue()); + assertNull(suffixToAdd.getArgumentDefaultValue().getValue()); } @@ -182,7 +182,7 @@ public void directive_suppliedDirectiveAnnotation_returnCorrectDirective() { assertNotNull(isActive); assertEquals(isActive.getName(), "isActive"); assertEquals(isActive.getType(), GraphQLBoolean); - assertEquals(true,isActive.getDefaultValue()); + assertEquals(true,isActive.getArgumentDefaultValue().getValue()); } @Test(expectedExceptions = GraphQLAnnotationsException.class) diff --git a/src/test/java/graphql/annotations/GraphQLDirectivesViaAnnotationDefinitionTest.java b/src/test/java/graphql/annotations/GraphQLDirectivesViaAnnotationDefinitionTest.java index bb234144..bf46037c 100644 --- a/src/test/java/graphql/annotations/GraphQLDirectivesViaAnnotationDefinitionTest.java +++ b/src/test/java/graphql/annotations/GraphQLDirectivesViaAnnotationDefinitionTest.java @@ -57,7 +57,7 @@ public static class UpperWiring implements AnnotationsDirectiveWiring { @Override public GraphQLFieldDefinition onField(AnnotationsWiringEnvironment environment) { GraphQLFieldDefinition field = (GraphQLFieldDefinition) environment.getElement(); - boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getValue(); + boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getArgumentValue().getValue(); CodeRegistryUtil.wrapDataFetcher(field, environment, (((dataFetchingEnvironment, value) -> { if (value instanceof String && isActive) { return ((String) value).toUpperCase(); @@ -73,17 +73,17 @@ public static class SuffixWiring implements AnnotationsDirectiveWiring { @Override public GraphQLInputObjectField onInputObjectField(AnnotationsWiringEnvironment environment) { GraphQLInputObjectField field = (GraphQLInputObjectField) environment.getElement(); - boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getValue(); + boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getArgumentValue().getValue(); if (!isActive) return field; - String suffix = (String) environment.getDirective().getArgument("suffix").getValue(); + String suffix = (String) environment.getDirective().getArgument("suffix").getArgumentValue().getValue(); return field.transform(builder -> builder.name(field.getName() + suffix)); } @Override public GraphQLFieldDefinition onField(AnnotationsWiringEnvironment environment) { GraphQLFieldDefinition field = (GraphQLFieldDefinition) environment.getElement(); - String suffix = (String) environment.getDirective().getArgument("suffix").getValue(); - boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getValue(); + String suffix = (String) environment.getDirective().getArgument("suffix").getArgumentValue().getValue(); + boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getArgumentValue().getValue(); if (!isActive) return field; CodeRegistryUtil.wrapDataFetcher(field, environment, (dataFetchingEnvironment, value) -> { if (value instanceof String) { @@ -98,8 +98,8 @@ public GraphQLFieldDefinition onField(AnnotationsWiringEnvironment environment) @Override public GraphQLArgument onArgument(AnnotationsWiringEnvironment environment) { GraphQLArgument element = (GraphQLArgument) environment.getElement(); - String suffix = (String) environment.getDirective().getArgument("suffix").getValue(); - boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getValue(); + String suffix = (String) environment.getDirective().getArgument("suffix").getArgumentValue().getValue(); + boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getArgumentValue().getValue(); if (!isActive) return element; return element.transform(builder -> builder.name(element.getName() + suffix)); } @@ -107,9 +107,9 @@ public GraphQLArgument onArgument(AnnotationsWiringEnvironment environment) { @Override public GraphQLInputObjectType onInputObjectType(AnnotationsWiringEnvironment environment) { GraphQLInputObjectType element = (GraphQLInputObjectType) environment.getElement(); - boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getValue(); + boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getArgumentValue().getValue(); if (!isActive) return element; - String suffix = (String) environment.getDirective().getArgument("suffix").getValue(); + String suffix = (String) environment.getDirective().getArgument("suffix").getArgumentValue().getValue(); return element; } } @@ -118,7 +118,7 @@ public static class DirectiveWithListWiring implements AnnotationsDirectiveWirin @Override public GraphQLFieldDefinition onField(AnnotationsWiringEnvironment environment) { GraphQLFieldDefinition field = (GraphQLFieldDefinition) environment.getElement(); - String[] list= (String[]) environment.getDirective().getArgument("list").getValue(); + String[] list= (String[]) environment.getDirective().getArgument("list").getArgumentValue().getValue(); CodeRegistryUtil.wrapDataFetcher(field, environment, (dataFetchingEnvironment, value) -> value + list[0]); return field; } diff --git a/src/test/java/graphql/annotations/GraphQLDirectivesViaClassDefinitionTest.java b/src/test/java/graphql/annotations/GraphQLDirectivesViaClassDefinitionTest.java index 30ff45ba..f3117194 100644 --- a/src/test/java/graphql/annotations/GraphQLDirectivesViaClassDefinitionTest.java +++ b/src/test/java/graphql/annotations/GraphQLDirectivesViaClassDefinitionTest.java @@ -52,7 +52,7 @@ public static class UpperWiring implements AnnotationsDirectiveWiring { @Override public GraphQLFieldDefinition onField(AnnotationsWiringEnvironment environment) { GraphQLFieldDefinition field = (GraphQLFieldDefinition) environment.getElement(); - boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getValue(); + boolean isActive = (boolean) environment.getDirective().getArgument("isActive").getArgumentValue().getValue(); CodeRegistryUtil.wrapDataFetcher(field, environment, (((dataFetchingEnvironment, value) -> { if (value instanceof String && isActive) { return ((String) value).toUpperCase(); @@ -68,14 +68,14 @@ public static class SuffixWiring implements AnnotationsDirectiveWiring { @Override public GraphQLInputObjectField onInputObjectField(AnnotationsWiringEnvironment environment) { GraphQLInputObjectField field = (GraphQLInputObjectField) environment.getElement(); - String suffix = (String) environment.getDirective().getArgument("suffix").getValue(); + String suffix = (String) environment.getDirective().getArgument("suffix").getArgumentValue().getValue(); return field.transform(builder -> builder.name(field.getName() + suffix)); } @Override public GraphQLFieldDefinition onField(AnnotationsWiringEnvironment environment) { GraphQLFieldDefinition field = (GraphQLFieldDefinition) environment.getElement(); - String suffix = (String) environment.getDirective().getArgument("suffix").getValue(); + String suffix = (String) environment.getDirective().getArgument("suffix").getArgumentValue().getValue(); CodeRegistryUtil.wrapDataFetcher(field, environment, (dataFetchingEnvironment, value) -> { if (value instanceof String) { return value + suffix; @@ -89,14 +89,14 @@ public GraphQLFieldDefinition onField(AnnotationsWiringEnvironment environment) @Override public GraphQLArgument onArgument(AnnotationsWiringEnvironment environment) { GraphQLArgument element = (GraphQLArgument) environment.getElement(); - String suffix = (String) environment.getDirective().getArgument("suffix").getValue(); + String suffix = (String) environment.getDirective().getArgument("suffix").getArgumentValue().getValue(); return element.transform(builder -> builder.name(element.getName() + suffix)); } @Override public GraphQLInputObjectType onInputObjectType(AnnotationsWiringEnvironment environment) { GraphQLInputObjectType element = (GraphQLInputObjectType) environment.getElement(); - String suffix = (String) environment.getDirective().getArgument("suffix").getValue(); + String suffix = (String) environment.getDirective().getArgument("suffix").getArgumentValue().getValue(); return element; } } diff --git a/src/test/java/graphql/annotations/GraphQLObjectTest.java b/src/test/java/graphql/annotations/GraphQLObjectTest.java index 299a64d8..246d3473 100644 --- a/src/test/java/graphql/annotations/GraphQLObjectTest.java +++ b/src/test/java/graphql/annotations/GraphQLObjectTest.java @@ -352,15 +352,15 @@ public Type id() { } } - public static class TestObjectBridgMethod extends TestObjectBridgMethodParent { + public static class TestObjectBridgMethod extends TestObjectBridgMethodParent { public TestObjectBridgMethod() { - super(1L); + super("1"); } @Override @GraphQLField - public Long id() { + public String id() { return super.id(); } } @@ -370,7 +370,7 @@ public void methodInheritanceWithGenerics() { GraphQLSchema schema = newAnnotationsSchema().query(TestObjectBridgMethod.class).build(); ExecutionResult result = GraphQL.newGraphQL(schema).build().execute("{id}", new TestObjectBridgMethod()); - assertEquals(((Map) result.getData()).get("id"), 1L); + assertEquals(((Map) result.getData()).get("id"), "1"); } public interface Iface { diff --git a/src/test/java/graphql/annotations/directives/creation/DirectiveArgumentCreatorTest.java b/src/test/java/graphql/annotations/directives/creation/DirectiveArgumentCreatorTest.java index fa5f2b68..3ca67618 100644 --- a/src/test/java/graphql/annotations/directives/creation/DirectiveArgumentCreatorTest.java +++ b/src/test/java/graphql/annotations/directives/creation/DirectiveArgumentCreatorTest.java @@ -86,7 +86,7 @@ public void getArgument_goodFieldSupplied_correctArgumentCreated() throws NoSuch GraphQLArgument isActive = directiveArgumentCreator.getArgument(this.getClass().getDeclaredField("isActive"), DirectiveArgumentCreatorTest.class); // Assert assertEquals(isActive.getName(), "isActive"); - assertEquals(isActive.getDefaultValue(), true); + assertEquals(isActive.getArgumentDefaultValue().getValue(), true); assertEquals(isActive.getDescription(), "isActive"); assertEquals(isActive.getType(), GraphQLBoolean); } @@ -100,7 +100,7 @@ public void getArgument_goodMethodSuppliedWithoutGraphQLName_correctArgumentCrea // Assert assertEquals(argument.getName(), "suffix"); - assertEquals(argument.getDefaultValue(), "bla"); + assertEquals(argument.getArgumentDefaultValue().getValue(), "bla"); assertEquals(argument.getDescription(), null); assertEquals(argument.getType(), GraphQLString); } @@ -112,7 +112,7 @@ public void getArgument_goodMethodSuppliedWithGraphQLData_correctArgumentCreated // Assert assertEquals(argument.getName(), "suffix1"); - assertEquals(argument.getDefaultValue(), null); + assertEquals(argument.getArgumentDefaultValue().getValue(), null); assertEquals(argument.getDescription(), "bla"); assertEquals(argument.getType(), GraphQLString); } @@ -139,7 +139,7 @@ public void getArgument_goodParameterSuppliedWithoutGraphQLName_correctArgumentC // Assert assertEquals(argument.getName(), "arg0"); - assertEquals(argument.getDefaultValue(), null); + assertEquals(argument.getArgumentDefaultValue().getValue(), null); assertEquals(argument.getDescription(), null); assertEquals(argument.getType(), GraphQLString); } @@ -151,7 +151,7 @@ public void getArgument_goodParameterSuppliedWithGraphQLData_correctArgumentCrea // Assert assertEquals(argument.getName(), "suffix"); - assertEquals(argument.getDefaultValue(), null); + assertEquals(argument.getArgumentDefaultValue().getValue(), null); assertEquals(argument.getDescription(), "the suffix"); assertEquals(argument.getType(), GraphQLString); } diff --git a/src/test/java/graphql/annotations/directives/creation/DirectiveCreatorTest.java b/src/test/java/graphql/annotations/directives/creation/DirectiveCreatorTest.java index d1e70cdc..2519384e 100644 --- a/src/test/java/graphql/annotations/directives/creation/DirectiveCreatorTest.java +++ b/src/test/java/graphql/annotations/directives/creation/DirectiveCreatorTest.java @@ -85,6 +85,6 @@ public void getDirective_goodDirectiveClass_directiveIsCorrect() { assertNotNull(isActive); assertEquals(isActive.getName(), "isActive"); assertEquals(isActive.getType(), GraphQLBoolean); - assertEquals(isActive.getDefaultValue(), true); + assertEquals(isActive.getArgumentDefaultValue().getValue(), true); } } diff --git a/src/test/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilderTest.java b/src/test/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilderTest.java index 513c08af..fc170f48 100644 --- a/src/test/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilderTest.java +++ b/src/test/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilderTest.java @@ -116,7 +116,7 @@ public void testDecoratedField_directivesAreInRegistry_directivesAreBuilt() thro assertEquals(graphQLDirectives[1].getName(), "upperCase"); assertFalse(graphQLDirectives[1].getArguments().isEmpty()); assertEquals(graphQLDirectives[1].getArguments().get(0).getName(), "myArg"); - assertEquals(graphQLDirectives[1].getArguments().get(0).getValue(), "DefaultString"); + assertEquals(graphQLDirectives[1].getArguments().get(0).getArgumentValue().getValue(), "DefaultString"); assertEquals(graphQLDirectives[2].getName(), "lowerCase"); assertTrue(graphQLDirectives[2].getArguments().isEmpty()); @@ -141,7 +141,7 @@ public void testDecoratedFieldWithArguments_directivesAreInRegistry_directivesAr assertEquals(graphQLDirectives[0].getName(), "upperCase"); assertFalse(graphQLDirectives[0].getArguments().isEmpty()); assertEquals(graphQLDirectives[0].getArguments().get(0).getName(), "myArg"); - assertEquals(graphQLDirectives[0].getArguments().get(0).getValue(), "This is a string"); + assertEquals(graphQLDirectives[0].getArguments().get(0).getArgumentValue().getValue(), "This is a string"); assertEquals(graphQLDirectives[1].getName(), "lowerCase"); assertTrue(graphQLDirectives[1].getArguments().isEmpty()); } @@ -221,10 +221,10 @@ public void testDecoratedFieldWithArguments_moreArgumentsThanArgumentsValues_dir assertEquals(graphQLDirectives[0].getArguments().size(), 2); assertEquals(graphQLDirectives[0].getArguments().get(0).getName(), "arg"); - assertEquals(graphQLDirectives[0].getArguments().get(0).getValue(), "This is a string"); + assertEquals(graphQLDirectives[0].getArguments().get(0).getArgumentValue().getValue(), "This is a string"); assertEquals(graphQLDirectives[0].getArguments().get(1).getName(), "arg2"); - assertEquals(graphQLDirectives[0].getArguments().get(1).getValue(), "5"); + assertEquals(graphQLDirectives[0].getArguments().get(1).getArgumentValue().getValue(), "5"); } // Argument @@ -264,7 +264,7 @@ public void testDecoratedArgument_directivesAreInRegistry_directivesAreBuilt() t assertEquals(graphQLDirectives[1].getName(), "upperCase"); assertFalse(graphQLDirectives[1].getArguments().isEmpty()); assertEquals(graphQLDirectives[1].getArguments().get(0).getName(), "myArg"); - assertEquals(graphQLDirectives[1].getArguments().get(0).getValue(), "DefaultString"); + assertEquals(graphQLDirectives[1].getArguments().get(0).getArgumentValue().getValue(), "DefaultString"); } @Test @@ -286,7 +286,7 @@ public void testDecoratedParameterWithArguments_directivesAreInRegistry_directiv assertEquals(graphQLDirectives[0].getName(), "upperCase"); assertFalse(graphQLDirectives[0].getArguments().isEmpty()); assertEquals(graphQLDirectives[0].getArguments().get(0).getName(), "myArg"); - assertEquals(graphQLDirectives[0].getArguments().get(0).getValue(), "This is a string"); + assertEquals(graphQLDirectives[0].getArguments().get(0).getArgumentValue().getValue(), "This is a string"); } // Class @@ -327,7 +327,7 @@ public void testDecoratedClass_directivesAreInRegistry_directivesAreBuilt() thro assertEquals(graphQLDirectives[1].getName(), "upperCase"); assertFalse(graphQLDirectives[1].getArguments().isEmpty()); assertEquals(graphQLDirectives[1].getArguments().get(0).getName(), "myArg"); - assertEquals(graphQLDirectives[1].getArguments().get(0).getValue(), "DefaultString"); + assertEquals(graphQLDirectives[1].getArguments().get(0).getArgumentValue().getValue(), "DefaultString"); assertEquals(graphQLDirectives[2].getName(), "lowerCase"); assertTrue(graphQLDirectives[2].getArguments().isEmpty()); @@ -352,7 +352,7 @@ public void testDecoratedClassWithArguments_directivesAreInRegistry_directivesAr assertEquals(graphQLDirectives[0].getName(), "upperCase"); assertFalse(graphQLDirectives[0].getArguments().isEmpty()); assertEquals(graphQLDirectives[0].getArguments().get(0).getName(), "myArg"); - assertEquals(graphQLDirectives[0].getArguments().get(0).getValue(), "This is a string"); + assertEquals(graphQLDirectives[0].getArguments().get(0).getArgumentValue().getValue(), "This is a string"); assertEquals(graphQLDirectives[1].getName(), "lowerCase"); assertTrue(graphQLDirectives[1].getArguments().isEmpty()); } diff --git a/src/test/java/graphql/annotations/processor/typeFunctions/BigDecimalFunctionTests.java b/src/test/java/graphql/annotations/processor/typeFunctions/BigDecimalFunctionTests.java index 40816ea8..2c6b85fc 100644 --- a/src/test/java/graphql/annotations/processor/typeFunctions/BigDecimalFunctionTests.java +++ b/src/test/java/graphql/annotations/processor/typeFunctions/BigDecimalFunctionTests.java @@ -18,8 +18,8 @@ import java.math.BigDecimal; -import static graphql.Scalars.GraphQLBigDecimal; import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction; +import static graphql.scalars.ExtendedScalars.GraphQLBigDecimal; import static org.testng.Assert.assertEquals; public class BigDecimalFunctionTests { diff --git a/src/test/java/graphql/annotations/processor/typeFunctions/BigIntegerFunctionTests.java b/src/test/java/graphql/annotations/processor/typeFunctions/BigIntegerFunctionTests.java index 8293ca5b..915602f6 100644 --- a/src/test/java/graphql/annotations/processor/typeFunctions/BigIntegerFunctionTests.java +++ b/src/test/java/graphql/annotations/processor/typeFunctions/BigIntegerFunctionTests.java @@ -14,14 +14,13 @@ */ package graphql.annotations.processor.typeFunctions; -import org.testng.annotations.Test; - -import java.math.BigInteger; - -import static graphql.Scalars.GraphQLBigInteger; import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction; +import static graphql.scalars.ExtendedScalars.GraphQLBigInteger; import static org.testng.Assert.assertEquals; +import java.math.BigInteger; +import org.testng.annotations.Test; + public class BigIntegerFunctionTests { @Test public void buildType_bigIntegerType_returnsGraphQLBigInteger() { diff --git a/src/test/java/graphql/annotations/processor/typeFunctions/ByteFunctionTests.java b/src/test/java/graphql/annotations/processor/typeFunctions/ByteFunctionTests.java index 4a733331..ebe90f04 100644 --- a/src/test/java/graphql/annotations/processor/typeFunctions/ByteFunctionTests.java +++ b/src/test/java/graphql/annotations/processor/typeFunctions/ByteFunctionTests.java @@ -14,12 +14,12 @@ */ package graphql.annotations.processor.typeFunctions; -import org.testng.annotations.Test; - -import static graphql.Scalars.GraphQLByte; import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction; +import static graphql.scalars.ExtendedScalars.GraphQLByte; import static org.testng.Assert.assertEquals; +import org.testng.annotations.Test; + public class ByteFunctionTests { @Test public void buildType_byteType_returnsGraphQLByte() { diff --git a/src/test/java/graphql/annotations/processor/typeFunctions/CharFunctionTests.java b/src/test/java/graphql/annotations/processor/typeFunctions/CharFunctionTests.java index 7d057037..50ed3914 100644 --- a/src/test/java/graphql/annotations/processor/typeFunctions/CharFunctionTests.java +++ b/src/test/java/graphql/annotations/processor/typeFunctions/CharFunctionTests.java @@ -14,12 +14,12 @@ */ package graphql.annotations.processor.typeFunctions; -import org.testng.annotations.Test; - -import static graphql.Scalars.GraphQLChar; import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction; +import static graphql.scalars.ExtendedScalars.GraphQLChar; import static org.testng.Assert.assertEquals; +import org.testng.annotations.Test; + public class CharFunctionTests { @Test public void buildType_characterType_returnsGraphQLChar() { diff --git a/src/test/java/graphql/annotations/processor/typeFunctions/LongFunctionTests.java b/src/test/java/graphql/annotations/processor/typeFunctions/LongFunctionTests.java index a06822e1..9223da81 100644 --- a/src/test/java/graphql/annotations/processor/typeFunctions/LongFunctionTests.java +++ b/src/test/java/graphql/annotations/processor/typeFunctions/LongFunctionTests.java @@ -15,12 +15,12 @@ package graphql.annotations.processor.typeFunctions; -import org.testng.annotations.Test; - -import static graphql.Scalars.GraphQLLong; import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction; +import static graphql.scalars.ExtendedScalars.GraphQLLong; import static org.testng.Assert.assertEquals; +import org.testng.annotations.Test; + public class LongFunctionTests { @Test public void buildType_longType_returnsGraphQLLong() { diff --git a/src/test/java/graphql/annotations/processor/typeFunctions/ShortFunctionTests.java b/src/test/java/graphql/annotations/processor/typeFunctions/ShortFunctionTests.java index 9e38b59f..bd98e2ba 100644 --- a/src/test/java/graphql/annotations/processor/typeFunctions/ShortFunctionTests.java +++ b/src/test/java/graphql/annotations/processor/typeFunctions/ShortFunctionTests.java @@ -14,12 +14,12 @@ */ package graphql.annotations.processor.typeFunctions; -import org.testng.annotations.Test; - -import static graphql.Scalars.GraphQLShort; import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction; +import static graphql.scalars.ExtendedScalars.GraphQLShort; import static org.testng.Assert.assertEquals; +import org.testng.annotations.Test; + public class ShortFunctionTests { @Test public void buildType_shortType_returnsGraphQLShort() {