diff --git a/src/test/groovy/com/intuit/graphql/orchestrator/integration/CustomScalarsSpec.groovy b/src/test/groovy/com/intuit/graphql/orchestrator/integration/CustomScalarsSpec.groovy index e4e2b60f..0819fd07 100644 --- a/src/test/groovy/com/intuit/graphql/orchestrator/integration/CustomScalarsSpec.groovy +++ b/src/test/groovy/com/intuit/graphql/orchestrator/integration/CustomScalarsSpec.groovy @@ -1,6 +1,7 @@ package com.intuit.graphql.orchestrator.integration import com.intuit.graphql.orchestrator.GraphQLOrchestrator +import com.intuit.graphql.orchestrator.testhelpers.SimpleMockServiceProvider import graphql.ExecutionInput import graphql.ExecutionResult import graphql.schema.GraphQLArgument @@ -64,6 +65,8 @@ class CustomScalarsSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + "query QUERY { uuid url }", (SimpleMockServiceProvider) testService) executionResult.getErrors().isEmpty() Map data = executionResult.getData() data.uuid instanceof String && data.uuid == "123e4567-e89b-12d3-a456-426614174000" diff --git a/src/test/groovy/com/intuit/graphql/orchestrator/integration/DeprecatedSpec.groovy b/src/test/groovy/com/intuit/graphql/orchestrator/integration/DeprecatedSpec.groovy index ed62beb3..7952d0d5 100644 --- a/src/test/groovy/com/intuit/graphql/orchestrator/integration/DeprecatedSpec.groovy +++ b/src/test/groovy/com/intuit/graphql/orchestrator/integration/DeprecatedSpec.groovy @@ -1,6 +1,7 @@ package com.intuit.graphql.orchestrator.integration import com.intuit.graphql.orchestrator.GraphQLOrchestrator +import com.intuit.graphql.orchestrator.testhelpers.SimpleMockServiceProvider import graphql.ExecutionInput import graphql.ExecutionResult import helpers.BaseIntegrationTestSpecification @@ -53,6 +54,9 @@ class DeprecatedSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + 'query TestQuery($a1: String, $a2: InputType) {x(arg1: $a1, arg2: $a2)}', + (SimpleMockServiceProvider) testService) executionResult.getErrors().isEmpty() Map data = executionResult.getData() data.x instanceof String && data.x == "some value for x" diff --git a/src/test/groovy/com/intuit/graphql/orchestrator/integration/DirectivesOnVariableDefinitionSpec.groovy b/src/test/groovy/com/intuit/graphql/orchestrator/integration/DirectivesOnVariableDefinitionSpec.groovy index f231774d..e3875c83 100644 --- a/src/test/groovy/com/intuit/graphql/orchestrator/integration/DirectivesOnVariableDefinitionSpec.groovy +++ b/src/test/groovy/com/intuit/graphql/orchestrator/integration/DirectivesOnVariableDefinitionSpec.groovy @@ -1,6 +1,7 @@ package com.intuit.graphql.orchestrator.integration import com.intuit.graphql.orchestrator.GraphQLOrchestrator +import com.intuit.graphql.orchestrator.testhelpers.SimpleMockServiceProvider import graphql.ExecutionInput import graphql.ExecutionResult import graphql.language.Directive @@ -51,6 +52,9 @@ class DirectivesOnVariableDefinitionSpec extends BaseIntegrationTestSpecificatio ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + 'query TestQuery($stringVar: String @directiveOnVar(dirArg : "dirArgValue")){field(stringArg: $stringVar)}', + (SimpleMockServiceProvider) testService) executionResult.getErrors().isEmpty() Map data = executionResult.getData() data.field instanceof String && data.field == "SomeString" diff --git a/src/test/groovy/com/intuit/graphql/orchestrator/integration/DownstreamVariableSplittingSpec.groovy b/src/test/groovy/com/intuit/graphql/orchestrator/integration/DownstreamVariableSplittingSpec.groovy index c290603f..6a63f166 100644 --- a/src/test/groovy/com/intuit/graphql/orchestrator/integration/DownstreamVariableSplittingSpec.groovy +++ b/src/test/groovy/com/intuit/graphql/orchestrator/integration/DownstreamVariableSplittingSpec.groovy @@ -1,6 +1,7 @@ package com.intuit.graphql.orchestrator.integration import com.intuit.graphql.orchestrator.GraphQLOrchestrator +import com.intuit.graphql.orchestrator.testhelpers.SimpleMockServiceProvider import graphql.ExecutionInput import graphql.ExecutionResult import helpers.BaseIntegrationTestSpecification @@ -69,6 +70,12 @@ class DownstreamVariableSplittingSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + 'query TestQuery($objectVarA: InputA){fieldA(objectArgA: $objectVarA)}', + (SimpleMockServiceProvider) testServiceA) + compareQueryToExecutionInput(null, + 'query TestQuery($stringVarB: String){fieldB(stringArgB: $stringVarB)}', + (SimpleMockServiceProvider) testServiceB) executionResult.getErrors().isEmpty() Map data = executionResult.getData() data.fieldA instanceof String && data.fieldA == "SomeStringA" diff --git a/src/test/groovy/com/intuit/graphql/orchestrator/integration/XtextConflictResolverSpec.groovy b/src/test/groovy/com/intuit/graphql/orchestrator/integration/XtextConflictResolverSpec.groovy index 09ee5369..31f716cf 100644 --- a/src/test/groovy/com/intuit/graphql/orchestrator/integration/XtextConflictResolverSpec.groovy +++ b/src/test/groovy/com/intuit/graphql/orchestrator/integration/XtextConflictResolverSpec.groovy @@ -178,6 +178,10 @@ class XtextConflictResolverSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + "query QUERY { a { test alpha } }", (SimpleMockServiceProvider) serviceA) + compareQueryToExecutionInput(null, + null, (SimpleMockServiceProvider) serviceB) executionResult.getErrors().isEmpty() specUnderTest.runtimeGraph?.getType("MyType1") != null @@ -215,6 +219,10 @@ class XtextConflictResolverSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + null, (SimpleMockServiceProvider) serviceA) + compareQueryToExecutionInput(null, + "query QUERY { b { test beta } }", (SimpleMockServiceProvider) serviceB) executionResult.getErrors().isEmpty() specUnderTest.runtimeGraph?.getType("MyType1") != null @@ -305,6 +313,10 @@ class XtextConflictResolverSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + "query QUERY { a { test alpha } }", (SimpleMockServiceProvider) serviceA) + compareQueryToExecutionInput(null, + null, (SimpleMockServiceProvider) serviceB) executionResult.getErrors().isEmpty() specUnderTest.runtimeGraph?.getExecutableSchema().getType("Query").getFieldDefinition("b") == null @@ -342,6 +354,10 @@ class XtextConflictResolverSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + null, (SimpleMockServiceProvider) serviceA) + compareQueryToExecutionInput(null, + "query QUERY { bb { test beta } }", (SimpleMockServiceProvider) serviceB) executionResult.getErrors().isEmpty() specUnderTest.runtimeGraph?.getExecutableSchema().getType("Query").getFieldDefinition("b") == null @@ -450,6 +466,10 @@ class XtextConflictResolverSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + "fragment NameFragment on IName { name } query QUERY { a {...NameFragment test alpha}}", (SimpleMockServiceProvider) serviceA) + compareQueryToExecutionInput(null, + null, (SimpleMockServiceProvider) serviceB) executionResult.getErrors().isEmpty() Map data = executionResult.getData() data.a?.name instanceof String && data.a?.name == "A A" @@ -487,6 +507,10 @@ class XtextConflictResolverSpec extends BaseIntegrationTestSpecification { ExecutionResult executionResult = specUnderTest.execute(executionInput).get() then: + compareQueryToExecutionInput(null, + null, (SimpleMockServiceProvider) serviceA) + compareQueryToExecutionInput(null, + "fragment NameFragment on ITheName { name } query QUERY { b {...NameFragment test beta}}", (SimpleMockServiceProvider) serviceB) executionResult.getErrors().isEmpty() Map data = executionResult.getData() data.b?.name instanceof String && data.b?.name == "B B"