Skip to content

Commit 97493ff

Browse files
Merge pull request #187 from tasneemkoushar/master
fix: made changes for service A, B, C, D, E
2 parents 73eee1e + 87a30ea commit 97493ff

File tree

8 files changed

+67
-183
lines changed

8 files changed

+67
-183
lines changed

src/test/groovy/com/intuit/graphql/orchestrator/integration/MutationNestedFieldsArgumentsSpec.groovy

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
package com.intuit.graphql.orchestrator.integration
22

33
import com.intuit.graphql.orchestrator.GraphQLOrchestrator
4-
import com.intuit.graphql.orchestrator.ServiceD
5-
import com.intuit.graphql.orchestrator.ServiceE
64
import com.intuit.graphql.orchestrator.ServiceProvider
75
import com.intuit.graphql.orchestrator.schema.transform.FieldMergeException
86
import helpers.BaseIntegrationTestSpecification
97

108
class MutationNestedFieldsArgumentsSpec extends BaseIntegrationTestSpecification {
9+
def mockDServiceResponse = [
10+
data: [
11+
serviceD: []
12+
]
13+
]
14+
15+
def mockEServiceResponse = [
16+
data: [
17+
serviceD: []
18+
]
19+
]
1120

1221
def "cannot Build Due To Mutation Nested Fields Has Mismatched Arguments"() {
22+
def serviceD = createSimpleMockService( "SVCD", "type Query { } "
23+
+ "type Mutation { container(in : String) : Container } "
24+
+ "type Container { serviceD : ServiceD } "
25+
+ "type ServiceD { svcDField1 : String }", mockDServiceResponse)
26+
27+
def serviceE = createSimpleMockService( "SVCE", "type Query { } "
28+
+ "type Mutation { container(out : String) : Container } "
29+
+ "type Container { serviceE : ServiceE } "
30+
+ "type ServiceE { svcEField1 : String }", mockEServiceResponse)
31+
32+
1333
given:
14-
ServiceProvider[] services = [ new ServiceD(), new ServiceE() ]
34+
ServiceProvider[] services = [ serviceD, serviceE ]
1535

1636
when:
1737
GraphQLOrchestrator orchestrator = createGraphQLOrchestrator(services)

src/test/groovy/com/intuit/graphql/orchestrator/integration/NestedFieldsArgumentsSpec.groovy

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
package com.intuit.graphql.orchestrator.integration
22

33
import com.intuit.graphql.orchestrator.GraphQLOrchestrator
4-
import com.intuit.graphql.orchestrator.ServiceA
5-
import com.intuit.graphql.orchestrator.ServiceB
64
import com.intuit.graphql.orchestrator.ServiceProvider
75
import com.intuit.graphql.orchestrator.schema.transform.FieldMergeException
86
import helpers.BaseIntegrationTestSpecification
97

108
class NestedFieldsArgumentsSpec extends BaseIntegrationTestSpecification {
9+
def mockAServiceResponse = [
10+
data: [
11+
serviceA: []
12+
]
13+
]
14+
15+
def mockBServiceResponse = [
16+
data: [
17+
serviceB: []
18+
]
19+
]
1120

1221
def "cannot Build Due To Query Nested Fields Has Mismatched Arguments"() {
22+
def serviceA = createSimpleMockService( "SVCA", "type Query { container : Container } "
23+
+ "type Container { serviceA : ServiceA } "
24+
+ "type ServiceA { svcAField1 : String }", mockAServiceResponse)
25+
26+
def serviceB = createSimpleMockService( "SVCB", "type Query { container(in : String) : Container } "
27+
+ "type Container { serviceB : ServiceB } "
28+
+ "type ServiceB { svcBField1 : String }", mockBServiceResponse)
29+
30+
1331
when:
14-
ServiceProvider[] services = [ new ServiceA(), new ServiceB() ]
32+
ServiceProvider[] services = [ serviceA, serviceB ]
1533
GraphQLOrchestrator orchestrator = createGraphQLOrchestrator(services)
1634

1735
then:

src/test/groovy/com/intuit/graphql/orchestrator/integration/NestedFieldsDirectivesSpec.groovy

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
package com.intuit.graphql.orchestrator.integration
22

33
import com.intuit.graphql.orchestrator.GraphQLOrchestrator
4-
import com.intuit.graphql.orchestrator.ServiceA
5-
import com.intuit.graphql.orchestrator.ServiceC
64
import com.intuit.graphql.orchestrator.ServiceProvider
75
import com.intuit.graphql.orchestrator.schema.transform.FieldMergeException
86
import helpers.BaseIntegrationTestSpecification
97

108
class NestedFieldsDirectivesSpec extends BaseIntegrationTestSpecification {
119

10+
def mockAServiceResponse = [
11+
data: [
12+
serviceA: []
13+
]
14+
]
15+
16+
def mockCServiceResponse = [
17+
data: [
18+
serviceC: []
19+
]
20+
]
21+
22+
1223
def "cannot Build Due To Query Nested Fields Has Mismatched Directives"() {
24+
def serviceA = createSimpleMockService( "SVCA", "type Query { container : Container } "
25+
+ "type Container { serviceA : ServiceA } "
26+
+ "type ServiceA { svcAField1 : String }", mockAServiceResponse)
27+
28+
def serviceC = createSimpleMockService( "SVCC", "type Query { container : Container @deprecated } "
29+
+ "type Container { serviceC : ServiceC } "
30+
+ "type ServiceC { svcCField1 : String }", mockCServiceResponse)
31+
32+
1333
when:
14-
ServiceProvider[] services = [new ServiceA(), new ServiceC() ]
34+
ServiceProvider[] services = [serviceA, serviceC]
1535
GraphQLOrchestrator orchestrator = createGraphQLOrchestrator(services)
1636

1737
then:

src/test/java/com/intuit/graphql/orchestrator/ServiceA.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/test/java/com/intuit/graphql/orchestrator/ServiceB.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/test/java/com/intuit/graphql/orchestrator/ServiceC.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/test/java/com/intuit/graphql/orchestrator/ServiceD.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/test/java/com/intuit/graphql/orchestrator/ServiceE.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)