@@ -68,6 +68,14 @@ isolated function testServerSideCacheWithDataLoader(string documentFile, string[
68
68
resetDispatchCounters ();
69
69
}
70
70
71
+ function dataProviderServerCacheWithDataloader() returns map < [string , string [], json , string []]> {
72
+ map < [string , string [], json , string []]> dataSet = {
73
+ " 1" : [" server_cache_with_dataloader" , [" server_cache_with_dataloader_1" , " server_cache_with_dataloader_2" , " server_cache_with_dataloader_1" ], (), [" A" , " B" , " A" ]],
74
+ " 2" : [" server_cache_eviction_with_dataloader" , [" server_cache_with_dataloader_1" , " server_cache_with_dataloader_2" , " server_cache_with_dataloader_3" ], (), [" A" , " B" , " A" ]]
75
+ };
76
+ return dataSet ;
77
+ }
78
+
71
79
@test :Config {
72
80
groups : [" server_cache" , " data_loader" ],
73
81
dataProvider : dataProviderServerCacheWithDataloaderInOperationalLevel
@@ -83,6 +91,14 @@ isolated function testServerSideCacheWithDataLoaderInOperationalLevel(string doc
83
91
resetDispatchCounters ();
84
92
}
85
93
94
+ function dataProviderServerCacheWithDataloaderInOperationalLevel() returns map < [string , string [], json , string []]> {
95
+ map < [string , string [], json , string []]> dataSet = {
96
+ " 1" : [" server_cache_with_dataloader_operational" , [" server_cache_with_dataloader_3" , " server_cache_with_dataloader_5" , " server_cache_with_dataloader_3" ], (), [" A" , " B" , " A" ]],
97
+ " 2" : [" server_cache_eviction_with_dataloader_operational" , [" server_cache_with_dataloader_3" , " server_cache_with_dataloader_5" , " server_cache_with_dataloader_4" ], (), [" A" , " B" , " A" ]]
98
+ };
99
+ return dataSet ;
100
+ }
101
+
86
102
@test :Config {
87
103
groups : [" server_cache" ],
88
104
dataProvider : dataProviderServerCacheOperationalLevel
@@ -97,33 +113,6 @@ isolated function testServerSideCacheInOperationalLevel(string documentFile, str
97
113
}
98
114
}
99
115
100
- @test :Config {
101
- groups : [" server_cache" ]
102
- }
103
- isolated function testServerSideCacheInOperationalLevelWithTTL() returns error ? {
104
- string url = " http://localhost:9091/server_cache_operations" ;
105
- string document = check getGraphqlDocumentFromFile (" server_cache_with_ttl" );
106
- runtime : sleep (21 );
107
-
108
- json actualPayload = check getJsonPayloadFromService (url , document , (), " A" );
109
- json expectedPayload = check getJsonContentFromFile (" server_cache_1" );
110
- assertJsonValuesWithOrder (actualPayload , expectedPayload );
111
-
112
- actualPayload = check getJsonPayloadFromService (url , document , (), " B" );
113
- expectedPayload = check getJsonContentFromFile (" server_cache_10" );
114
- assertJsonValuesWithOrder (actualPayload , expectedPayload );
115
-
116
- actualPayload = check getJsonPayloadFromService (url , document , (), " A" );
117
- expectedPayload = check getJsonContentFromFile (" server_cache_1" );
118
- assertJsonValuesWithOrder (actualPayload , expectedPayload );
119
-
120
- runtime : sleep (21 );
121
-
122
- actualPayload = check getJsonPayloadFromService (url , document , (), " A" );
123
- expectedPayload = check getJsonContentFromFile (" server_cache_9" );
124
- assertJsonValuesWithOrder (actualPayload , expectedPayload );
125
- }
126
-
127
116
function dataProviderServerCacheOperationalLevel() returns map < [string , string [], json , string []]> {
128
117
map < [string , string [], json , string []]> dataSet = {
129
118
" 1" : [" server_cache" , [" server_cache_1" , " server_cache_2" , " server_cache_1" ], (), [" A" , " B" , " A" ]],
@@ -146,14 +135,6 @@ function dataProviderServerCacheOperationalLevel() returns map<[string, string[]
146
135
return dataSet ;
147
136
}
148
137
149
- function dataProviderServerCacheWithDataloader() returns map < [string , string [], json , string []]> {
150
- map < [string , string [], json , string []]> dataSet = {
151
- " 1" : [" server_cache_with_dataloader" , [" server_cache_with_dataloader_1" , " server_cache_with_dataloader_2" , " server_cache_with_dataloader_1" ], (), [" A" , " B" , " A" ]],
152
- " 2" : [" server_cache_eviction_with_dataloader" , [" server_cache_with_dataloader_1" , " server_cache_with_dataloader_2" , " server_cache_with_dataloader_3" ], (), [" A" , " B" , " A" ]]
153
- };
154
- return dataSet ;
155
- }
156
-
157
138
@test :Config {
158
139
groups : [" server_cache" , " interceptors" ],
159
140
dataProvider : dataProviderServerCacheWithInterceptors
@@ -190,20 +171,39 @@ function dataProviderServerCacheWithInterceptors() returns map<[string, string[]
190
171
return dataSet ;
191
172
}
192
173
193
- function dataProviderServerCacheWithDataloaderInOperationalLevel() returns map < [string , string [], json , string []]> {
194
- map < [string , string [], json , string []]> dataSet = {
195
- " 1" : [" server_cache_with_dataloader_operational" , [" server_cache_with_dataloader_3" , " server_cache_with_dataloader_5" , " server_cache_with_dataloader_3" ], (), [" A" , " B" , " A" ]],
196
- " 2" : [" server_cache_eviction_with_dataloader_operational" , [" server_cache_with_dataloader_3" , " server_cache_with_dataloader_5" , " server_cache_with_dataloader_4" ], (), [" A" , " B" , " A" ]]
197
- };
198
- return dataSet ;
174
+ @test :Config {
175
+ groups : [" server_cache" ]
176
+ }
177
+ isolated function testServerSideCacheInOperationalLevelWithTTL() returns error ? {
178
+ string url = " http://localhost:9091/server_cache_operations" ;
179
+ string document = check getGraphqlDocumentFromFile (" server_cache_operations_with_TTL" );
180
+ runtime : sleep (21 );
181
+
182
+ json actualPayload = check getJsonPayloadFromService (url , document , (), " A" );
183
+ json expectedPayload = check getJsonContentFromFile (" server_cache_1" );
184
+ assertJsonValuesWithOrder (actualPayload , expectedPayload );
185
+
186
+ actualPayload = check getJsonPayloadFromService (url , document , (), " B" );
187
+ expectedPayload = check getJsonContentFromFile (" server_cache_10" );
188
+ assertJsonValuesWithOrder (actualPayload , expectedPayload );
189
+
190
+ actualPayload = check getJsonPayloadFromService (url , document , (), " A" );
191
+ expectedPayload = check getJsonContentFromFile (" server_cache_1" );
192
+ assertJsonValuesWithOrder (actualPayload , expectedPayload );
193
+
194
+ runtime : sleep (21 );
195
+
196
+ actualPayload = check getJsonPayloadFromService (url , document , (), " A" );
197
+ expectedPayload = check getJsonContentFromFile (" server_cache_9" );
198
+ assertJsonValuesWithOrder (actualPayload , expectedPayload );
199
199
}
200
200
201
201
@test :Config {
202
202
groups : [" server_cache" ]
203
203
}
204
204
isolated function testServerCacheEvictionWithTTL() returns error ? {
205
205
string url = " http://localhost:9091/field_caching_with_interceptors" ;
206
- string document = check getGraphqlDocumentFromFile (" server_cache_with_TTL " );
206
+ string document = check getGraphqlDocumentFromFile (" server_cache_fields_with_TTL " );
207
207
208
208
json actualPayload = check getJsonPayloadFromService (url , document , (), " A" );
209
209
json expectedPayload = check getJsonContentFromFile (" server_cache_eviction_with_TTL_1" );
0 commit comments