Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ jar {
attributes('Automatic-Module-Name': 'com.graphqljava')
}
}

tasks.withType(GroovyCompile) {
// Options when compiling Java using the Groovy plugin.
// (Groovy itself defaults to UTF-8 for Groovy code)
options.encoding = 'UTF-8'
groovyOptions.forkOptions.memoryMaximumSize = "4g"
}
dependencies {
implementation 'org.antlr:antlr4-runtime:' + antlrVersion
api 'com.graphql-java:java-dataloader:3.4.0'
Expand All @@ -106,13 +111,15 @@ dependencies {
antlr 'org.antlr:antlr4:' + antlrVersion
implementation 'com.google.guava:guava:' + guavaVersion
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0'
testImplementation 'org.codehaus.groovy:groovy:3.0.24'
testImplementation 'org.codehaus.groovy:groovy-json:3.0.24'
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
testImplementation 'net.bytebuddy:byte-buddy:1.17.5'
testImplementation 'org.objenesis:objenesis:3.4'
testImplementation 'org.apache.groovy:groovy:4.0.26"'
testImplementation 'org.apache.groovy:groovy-json:4.0.26'
testImplementation 'com.google.code.gson:gson:2.12.1'
testImplementation 'org.eclipse.jetty:jetty-server:11.0.25'
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.18.3'
testImplementation 'org.awaitility:awaitility-groovy:4.2.0'
testImplementation 'org.awaitility:awaitility-groovy:4.3.0'
testImplementation 'com.github.javafaker:javafaker:1.0.2'

testImplementation 'org.reactivestreams:reactive-streams-tck:' + reactiveStreamsVersion
Expand Down Expand Up @@ -220,9 +227,9 @@ generateGrammarSource {
outputDirectory = file("${project.buildDir}/generated-src/antlr/main/graphql/parser/antlr")
}
generateGrammarSource.inputs
.dir('src/main/antlr')
.withPropertyName('sourceDir')
.withPathSensitivity(PathSensitivity.RELATIVE)
.dir('src/main/antlr')
.withPropertyName('sourceDir')
.withPathSensitivity(PathSensitivity.RELATIVE)


task sourcesJar(type: Jar) {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8
org.gradle.jvmargs=-Dfile.encoding=UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import graphql.schema.GraphQLObjectType
import graphql.schema.GraphQLScalarType
import graphql.schema.idl.SchemaDirectiveWiring
import graphql.schema.idl.SchemaDirectiveWiringEnvironment
import org.jetbrains.annotations.Nullable
import spock.lang.Specification

import static graphql.schema.idl.RuntimeWiring.newRuntimeWiring
Expand Down Expand Up @@ -323,7 +322,7 @@ class ValueTraverserTest extends Specification {
]
def visitor = new ValueVisitor() {
@Override
Object visitArgumentValue(@Nullable Object coercedValue, GraphQLArgument graphQLArgument, ValueVisitor.InputElements inputElements) {
Object visitArgumentValue(Object coercedValue, GraphQLArgument graphQLArgument, ValueVisitor.InputElements inputElements) {
if (graphQLArgument.name == "arg2") {
return [name: "Harry Potter", age: 54]
}
Expand Down Expand Up @@ -402,15 +401,15 @@ class ValueTraverserTest extends Specification {
def visitor = new ValueVisitor() {

@Override
Object visitScalarValue(@Nullable Object coercedValue, GraphQLScalarType inputType, ValueVisitor.InputElements inputElements) {
Object visitScalarValue(Object coercedValue, GraphQLScalarType inputType, ValueVisitor.InputElements inputElements) {
if (coercedValue == "Tom Riddle") {
return "Happy Potter"
}
return coercedValue
}

@Override
Object visitAppliedDirectiveArgumentValue(@Nullable Object coercedValue, GraphQLAppliedDirectiveArgument graphQLAppliedDirectiveArgument, ValueVisitor.InputElements inputElements) {
Object visitAppliedDirectiveArgumentValue(Object coercedValue, GraphQLAppliedDirectiveArgument graphQLAppliedDirectiveArgument, ValueVisitor.InputElements inputElements) {
if (graphQLAppliedDirectiveArgument.name == "arg2") {
return [name: "Harry Potter", age: 54]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import graphql.execution.ResultPath
import graphql.execution.pubsub.CapturingSubscriber
import graphql.incremental.DelayedIncrementalPartialResult
import org.awaitility.Awaitility
import org.jetbrains.annotations.NotNull
import org.reactivestreams.Publisher
import spock.lang.Specification

Expand Down Expand Up @@ -242,7 +241,7 @@ class IncrementalCallStateDeferTest extends Specification {

def threadFactory = new ThreadFactory() {
@Override
Thread newThread(@NotNull Runnable r) {
Thread newThread(Runnable r) {
return new Thread(r, "SubscriberThread")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import graphql.schema.DataFetchingEnvironment
import graphql.schema.SingletonPropertyDataFetcher
import graphql.schema.StaticDataFetcher
import org.awaitility.Awaitility
import org.jetbrains.annotations.NotNull
import spock.lang.Specification

import java.util.concurrent.CompletableFuture
Expand Down Expand Up @@ -183,7 +182,6 @@ class InstrumentationTest extends Specification {
}
}

@NotNull
@Override
DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters, InstrumentationState state) {
System.out.println(String.format("t%s instrument DF for %s", Thread.currentThread().getId(), parameters.environment.getExecutionStepInfo().getPath()))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package graphql.execution.instrumentation

class TestingFieldFetchingInstrumentationContext extends TestingInstrumentContext<Map<String, Object>> implements FieldFetchingInstrumentationContext {
class TestingFieldFetchingInstrumentationContext extends TestingInstrumentContext<Object> implements FieldFetchingInstrumentationContext {

TestingFieldFetchingInstrumentationContext(Object op, Object executionList, Object throwableList, Boolean useOnDispatch) {
super(op, executionList, throwableList, useOnDispatch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.awaitility.Awaitility
import org.dataloader.BatchLoader
import org.dataloader.DataLoaderFactory
import org.dataloader.DataLoaderRegistry
import org.jetbrains.annotations.NotNull
import org.reactivestreams.Publisher
import reactor.core.publisher.Mono
import spock.lang.Specification
Expand Down Expand Up @@ -96,7 +95,6 @@ class DataLoaderDispatcherTest extends Specification {

def enhancingInstrumentation = new SimplePerformantInstrumentation() {

@NotNull
@Override
ExecutionInput instrumentExecutionInput(ExecutionInput executionInput, InstrumentationExecutionParameters parameters, InstrumentationState state) {
assert executionInput.getDataLoaderRegistry() == startingDataLoaderRegistry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import graphql.execution.ValuesResolver
import graphql.schema.DataFetcher
import graphql.schema.DataFetchingEnvironment
import graphql.schema.GraphQLInputType
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable
import spock.lang.Specification

import static graphql.language.TypeName.newTypeName
Expand All @@ -35,7 +33,7 @@ class InputInterceptorTest extends Specification {

InputInterceptor interceptor = new InputInterceptor() {
@Override
Object intercept(@Nullable Object value, @NotNull GraphQLInputType graphQLType, @NotNull GraphQLContext graphqlContext, @NotNull Locale locale) {
Object intercept(Object value, GraphQLInputType graphQLType, GraphQLContext graphqlContext, Locale locale) {
if (graphQLType == Scalars.GraphQLBoolean) {
return "truthy" == value ? false : value
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import graphql.execution.DataFetcherResult
import graphql.schema.DataFetcher
import graphql.schema.DataFetchingEnvironment
import graphql.schema.GraphQLTypeUtil
import org.jetbrains.annotations.NotNull
import spock.lang.Specification

import static graphql.ExecutionInput.newExecutionInput
Expand Down Expand Up @@ -106,8 +105,7 @@ class ExtensionsBuilderTest extends Specification {
def "can use a custom merger"() {
ExtensionsMerger merger = new ExtensionsMerger() {
@Override
@NotNull
Map<Object, Object> merge(@NotNull Map<Object, Object> leftMap, @NotNull Map<Object, Object> rightMap) {
Map<Object, Object> merge(Map<Object, Object> leftMap, Map<Object, Object> rightMap) {
return rightMap
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ input CharacterInput {
"subscriptionType": {"name":"SubscriptionType"},
"types": [
]
}"""
}}"""
def parsed = slurp(input)

when:
Expand Down Expand Up @@ -826,7 +826,7 @@ directiveArg: String = "default Value") on FIELD | FRAGMENT_SPREAD | INLINE_FRAG
"isRepeatable":true
}
]
}"""
}}"""
def parsed = slurp(input)

when:
Expand Down
3 changes: 1 addition & 2 deletions src/test/groovy/graphql/schema/CoercingTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import graphql.language.StringValue
import graphql.language.VariableReference
import graphql.schema.idl.RuntimeWiring
import graphql.schema.idl.TypeRuntimeWiring
import org.jetbrains.annotations.NotNull
import spock.lang.Specification

import java.time.ZonedDateTime
Expand Down Expand Up @@ -248,7 +247,7 @@ class CoercingTest extends Specification {
}

@Override
StringValue valueToLiteral(@NotNull Object input, @NotNull GraphQLContext graphQLContext, @NotNull Locale locale) {
StringValue valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
return new StringValue(input.toString())
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package graphql.schema

import graphql.GraphQLContext
import org.jetbrains.annotations.NotNull
import spock.lang.Specification

class DelegatingDataFetchingEnvironmentTest extends Specification {
Expand All @@ -23,7 +22,6 @@ class DelegatingDataFetchingEnvironmentTest extends Specification {

when:
def delegatingDFE = new DelegatingDataFetchingEnvironment(dfe) {
@NotNull
@Override
GraphQLContext getGraphQlContext() {
return GraphQLContext.of(["key": "overriddenContext"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PropertyDataFetcherClassLoadingTest extends Specification {
}

BrokenClass getBrokenThings() {
return BrokenClass.cast(null)
return new BrokenClass()
}
}

Expand Down
Loading