Skip to content

Commit 66b0037

Browse files
author
tmiddleton
committed
COH-31968 - Investigate failing GraphQL test - Re-enable tests (ce-main -> ce-25.03@115020)
[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v25.03/": change = 115021]
1 parent e720397 commit 66b0037

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

prj/examples/tutorials/500-graphql/complete/src/test/java/com/oracle/coherence/tutorials/graphql/GraphQLCompleteIT.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import io.helidon.microprofile.cdi.Main;
1111

1212
import io.helidon.microprofile.server.ServerCdiExtension;
13-
import io.helidon.microprofile.testing.junit5.HelidonTest;
1413

1514
import java.math.BigDecimal;
1615
import java.util.ArrayList;
@@ -50,7 +49,6 @@
5049
*
5150
* @author Tim Middleton 2020.01.29
5251
*/
53-
@HelidonTest
5452
public class GraphQLCompleteIT {
5553

5654
/**
@@ -144,6 +142,7 @@ public class GraphQLCompleteIT {
144142

145143
@BeforeAll
146144
public static void startup() {
145+
System.setProperty("coherence.wka", "127.0.0.1");
147146
Main.main(new String[0]);
148147

149148
ServerCdiExtension current = CDI.current().getBeanManager().getExtension(ServerCdiExtension.class);
@@ -161,15 +160,15 @@ public static void shutdown() {
161160
Main.shutdown();
162161
}
163162

164-
// @Test
163+
@Test
165164
public void testGetSchema() {
166165
WebTarget webTarget = getGraphQLWebTarget().path(GRAPHQL_WEB_CONTEXT).path(GRAPHQL_SCHEMA_URI);
167166
Response response = webTarget.request(MediaType.TEXT_PLAIN).get();
168167
assertNotNull(response);
169168
assertEquals(response.getStatus(), Response.Status.OK.getStatusCode());
170169
}
171170

172-
// @Test
171+
@Test
173172
@SuppressWarnings("unchecked")
174173
public void testQueries() {
175174
Map<String, Object> results = getGraphQLResults(CUSTOMERS);
@@ -193,15 +192,15 @@ public void testQueries() {
193192
assertEquals(1, results.size());
194193
results = (Map<String, Object>) results.get("createCustomer");
195194
assertEquals(5, results.size());
196-
assertEquals(results.get("name"), "Tim");
195+
assertEquals("Tim", results.get("name"));
197196

198197
results = getGraphQLResults(CREATE_ORDER);
199198
assertEquals(1, results.size());
200199
results = (Map<String, Object>) results.get("data");
201200
assertEquals(1, results.size());
202201
results = (Map<String, Object>) results.get("createOrder");
203202
assertEquals(4, results.size());
204-
assertEquals(results.get("orderTotal"), "$0.00");
203+
assertEquals("$0.00", results.get("orderTotal"));
205204
assertEquals(BigDecimal.valueOf(200), results.get("orderId"));
206205

207206
results = getGraphQLResults(ADD_ORDER_LINE);
@@ -284,7 +283,7 @@ protected Map<String, Object> getJsonResponse(Response response) {
284283
*/
285284
@SuppressWarnings("unchecked")
286285
public static Map<String, Object> convertJSONtoMap(String json) {
287-
if (json == null || json.trim().length() == 0) {
286+
if (json == null || json.trim().isEmpty()) {
288287
return Collections.emptyMap();
289288
}
290289
return JSONB.fromJson(json, LinkedHashMap.class);
@@ -313,6 +312,4 @@ protected String encode(String param) {
313312
public static String convertMapToJson(Map map) {
314313
return JSONB.toJson(map);
315314
}
316-
317-
318315
}

prj/examples/tutorials/500-graphql/initial/src/test/java/com/oracle/coherence/tutorials/graphql/GraphQLInitialIT.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
import io.helidon.microprofile.cdi.Main;
1818

19-
import io.helidon.microprofile.testing.junit5.HelidonTest;
20-
2119
import org.junit.jupiter.api.AfterAll;
2220
import org.junit.jupiter.api.BeforeAll;
2321
import org.junit.jupiter.api.Test;
@@ -30,11 +28,11 @@
3028
*
3129
* @author Tim Middleton 2020.01.29
3230
*/
33-
@HelidonTest
3431
public class GraphQLInitialIT {
3532

3633
@BeforeAll
3734
public static void startup() {
35+
System.setProperty("coherence.wka", "127.0.0.1");
3836
Main.main(new String[0]);
3937
}
4038

@@ -43,7 +41,7 @@ public static void shutdown() {
4341
Main.shutdown();
4442
}
4543

46-
// @Test
44+
@Test
4745
public void testCache() {
4846
Coherence coherence = Coherence.getInstance();
4947
if (coherence == null) {

0 commit comments

Comments
 (0)