@@ -18,33 +18,38 @@ import ballerina/graphql;
18
18
import ballerina /graphql_test_common as common ;
19
19
import ballerina /test ;
20
20
import ballerina /websocket ;
21
+ import ballerina /io ;
21
22
22
23
@test :Config {
23
24
groups : [" dataloader" , " query" ],
24
25
after : resetDispatchCounters
25
26
}
26
27
isolated function testDataLoaderWithQuery() returns error ? {
28
+ io : println (" start testDataLoaderWithQuery" );
27
29
graphql : Client graphqlClient = check new (" localhost:9090/dataloader" );
28
30
string document = check common : getGraphqlDocumentFromFile (" dataloader_with_query" );
29
31
json response = check graphqlClient -> execute (document );
30
32
json expectedPayload = check common : getJsonContentFromFile (" dataloader_with_query" );
31
33
common : assertJsonValuesWithOrder (response , expectedPayload );
32
34
assertDispatchCountForAuthorLoader (1 );
33
35
assertDispatchCountForBookLoader (1 );
36
+ io : println (" end testDataLoaderWithQuery" );
34
37
}
35
38
36
39
@test :Config {
37
40
groups : [" dataloader" , " query" ],
38
41
after : resetDispatchCounters
39
42
}
40
43
isolated function testDataLoaderWithDifferentAliasForSameField() returns error ? {
44
+ io : println (" start testDataLoaderWithDifferentAliasForSameField" );
41
45
graphql : Client graphqlClient = check new (" localhost:9090/dataloader" );
42
46
string document = check common : getGraphqlDocumentFromFile (" dataloader_with_different_alias_for_same_field" );
43
47
json response = check graphqlClient -> execute (document );
44
48
json expectedPayload = check common : getJsonContentFromFile (" dataloader_with_different_alias_for_same_field" );
45
49
common : assertJsonValuesWithOrder (response , expectedPayload );
46
50
assertDispatchCountForAuthorLoader (1 );
47
51
assertDispatchCountForBookLoader (1 );
52
+ io : println (" end testDataLoaderWithDifferentAliasForSameField" );
48
53
}
49
54
50
55
@test :Config {
@@ -75,51 +80,59 @@ isolated function testDataLoaderWithSubscription() returns error? {
75
80
after : resetDispatchCounters
76
81
}
77
82
isolated function testDataLoaderWithMutation() returns error ? {
83
+ io : println (" start testDataLoaderWithMutation" );
78
84
graphql : Client graphqlClient = check new (" localhost:9090/dataloader" );
79
85
string document = check common : getGraphqlDocumentFromFile (" dataloader_with_mutation" );
80
86
json response = check graphqlClient -> execute (document );
81
87
json expectedPayload = check common : getJsonContentFromFile (" dataloader_with_mutation" );
82
88
common : assertJsonValuesWithOrder (response , expectedPayload );
83
89
assertDispatchCountForUpdateAuthorLoader (1 );
84
90
assertDispatchCountForBookLoader (1 );
91
+ io : println (" end testDataLoaderWithMutation" );
85
92
}
86
93
87
94
@test :Config {
88
95
groups : [" dataloader" , " interceptor" ],
89
96
after : resetDispatchCounters
90
97
}
91
98
isolated function testDataLoaderWithInterceptors() returns error ? {
99
+ io : println (" start testDataLoaderWithInterceptors" );
92
100
graphql : Client graphqlClient = check new (" localhost:9090/dataloader_with_interceptor" );
93
101
string document = check common : getGraphqlDocumentFromFile (" dataloader_with_interceptor" );
94
102
json response = check graphqlClient -> execute (document );
95
103
json expectedPayload = check common : getJsonContentFromFile (" dataloader_with_interceptor" );
96
104
common : assertJsonValuesWithOrder (response , expectedPayload );
97
105
assertDispatchCountForAuthorLoader (1 );
98
106
assertDispatchCountForBookLoader (1 );
107
+ io : println (" end testDataLoaderWithInterceptors" );
99
108
}
100
109
101
110
@test :Config {
102
111
groups : [" dataloader" , " dispatch-error" ],
103
112
after : resetDispatchCounters
104
113
}
105
114
isolated function testBatchFunctionReturningErrors() returns error ? {
115
+ io : println (" start testBatchFunctionReturningErrors" );
106
116
graphql : Client graphqlClient = check new (" localhost:9090/dataloader" );
107
117
string document = check common : getGraphqlDocumentFromFile (" batch_function_returing_errors" );
108
118
json response = check graphqlClient -> execute (document );
109
119
json expectedPayload = check common : getJsonContentFromFile (" batch_function_returing_errors" );
110
120
common : assertJsonValuesWithOrder (response , expectedPayload );
111
121
assertDispatchCountForAuthorLoader (1 );
112
122
assertDispatchCountForBookLoader (0 );
123
+ io : println (" end testBatchFunctionReturningErrors" );
113
124
}
114
125
115
126
@test :Config {
116
127
groups : [" dataloader" , " dispatch-error" ],
117
128
after : resetDispatchCounters
118
129
}
119
130
isolated function testBatchFunctionReturingNonMatchingNumberOfResults() returns error ? {
131
+ io : println (" start testBatchFunctionReturingNonMatchingNumberOfResults" );
120
132
graphql : Client graphqlClient = check new (" localhost:9090/dataloader_with_faulty_batch_function" );
121
133
string document = check common : getGraphqlDocumentFromFile (" batch_function_returning_non_matcing_number_of_results" );
122
134
json response = check graphqlClient -> execute (document );
123
135
json expectedPayload = check common : getJsonContentFromFile (" batch_function_returning_non_matcing_number_of_results" );
124
136
common : assertJsonValuesWithOrder (response , expectedPayload );
137
+ io : println (" end testBatchFunctionReturingNonMatchingNumberOfResults" );
125
138
}
0 commit comments