Skip to content

Commit fb08554

Browse files
committed
Make integration tests more robust
1 parent 21cd896 commit fb08554

File tree

25 files changed

+202
-45
lines changed

25 files changed

+202
-45
lines changed

carts/src/test/java/com/oracle/coherence/examples/sockshop/spring/carts/CartMetricsTests.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -40,6 +40,10 @@
4040
@SpringBootTest(
4141
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
4242
properties = {
43+
"coherence.localhost=127.0.0.1",
44+
"coherence.ttl=0",
45+
"java.net.preferIPv4Stack=true",
46+
"coherence.wka=127.0.0.1",
4347
"management.tracing.sampling.probability=1.0",
4448
"coherence.metrics.http.enabled=true"
4549
}

carts/src/test/java/com/oracle/coherence/examples/sockshop/spring/carts/controller/CartControllerIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2022, Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -27,7 +27,14 @@
2727
/**
2828
* Integration tests for {@link CartRepository}.
2929
*/
30-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
30+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
31+
properties = {
32+
"coherence.localhost=127.0.0.1",
33+
"coherence.ttl=0",
34+
"java.net.preferIPv4Stack=true",
35+
"coherence.wka=127.0.0.1"
36+
}
37+
)
3138
public class CartControllerIT {
3239

3340
protected CartRepository carts;

carts/src/test/java/com/oracle/coherence/examples/sockshop/spring/carts/repository/CartResourceAsyncIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -15,7 +15,14 @@
1515
/**
1616
* Integration tests for {@link CartControllerAsync}.
1717
*/
18-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
18+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
19+
properties = {
20+
"coherence.localhost=127.0.0.1",
21+
"coherence.ttl=0",
22+
"java.net.preferIPv4Stack=true",
23+
"coherence.wka=127.0.0.1"
24+
}
25+
)
1926
public class CartResourceAsyncIT extends CartControllerIT {
2027

2128
protected String getBasePath() {

carts/src/test/java/com/oracle/coherence/examples/sockshop/spring/carts/repository/CoherenceCartRepositoryAsyncIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -13,7 +13,14 @@
1313
/**
1414
* Tests for Coherence repository implementation.
1515
*/
16-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
16+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
17+
properties = {
18+
"coherence.localhost=127.0.0.1",
19+
"coherence.ttl=0",
20+
"java.net.preferIPv4Stack=true",
21+
"coherence.wka=127.0.0.1"
22+
}
23+
)
1724
class CoherenceCartRepositoryAsyncIT extends CartRepositoryTest {
1825

1926
/**

carts/src/test/java/com/oracle/coherence/examples/sockshop/spring/carts/repository/CoherenceCartRepositoryIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -13,7 +13,14 @@
1313
/**
1414
* Tests for Coherence repository implementation.
1515
*/
16-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
16+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
17+
properties = {
18+
"coherence.localhost=127.0.0.1",
19+
"coherence.ttl=0",
20+
"java.net.preferIPv4Stack=true",
21+
"coherence.wka=127.0.0.1"
22+
}
23+
)
1724
class CoherenceCartRepositoryIT extends CartRepositoryTest {
1825

1926
/**

catalog/src/test/java/com/oracle/coherence/examples/sockshop/spring/catalog/CatalogMetricsTests.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -42,7 +42,11 @@
4242
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
4343
properties = {
4444
"management.tracing.sampling.probability=1.0",
45-
"coherence.metrics.http.enabled=true"
45+
"coherence.metrics.http.enabled=true",
46+
"coherence.localhost=127.0.0.1",
47+
"coherence.ttl=0",
48+
"java.net.preferIPv4Stack=true",
49+
"coherence.wka=127.0.0.1"
4650
}
4751
)
4852
@AutoConfigureObservability

catalog/src/test/java/com/oracle/coherence/examples/sockshop/spring/catalog/CatalogResourceIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024 Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -22,7 +22,14 @@
2222
/**
2323
* Integration tests for {@link CatalogController}.
2424
*/
25-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
25+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
26+
properties = {
27+
"coherence.localhost=127.0.0.1",
28+
"coherence.ttl=0",
29+
"java.net.preferIPv4Stack=true",
30+
"coherence.wka=127.0.0.1"
31+
}
32+
)
2633
public class CatalogResourceIT {
2734

2835
@LocalServerPort

catalog/src/test/java/com/oracle/coherence/examples/sockshop/spring/catalog/CoherenceCatalogRepositoryIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -12,7 +12,14 @@
1212
/**
1313
* Tests for Coherence repository implementation.
1414
*/
15-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
15+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
16+
properties = {
17+
"coherence.localhost=127.0.0.1",
18+
"coherence.ttl=0",
19+
"java.net.preferIPv4Stack=true",
20+
"coherence.wka=127.0.0.1"
21+
}
22+
)
1623
class CoherenceCatalogRepositoryIT extends CatalogRepositoryTest {
1724

1825
@BeforeAll

orders/src/test/java/com/oracle/coherence/examples/sockshop/spring/orders/CoherenceOrderRepositoryIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -21,7 +21,14 @@
2121
/**
2222
* Tests for Coherence repository implementation.
2323
*/
24-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
24+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
25+
properties = {
26+
"coherence.localhost=127.0.0.1",
27+
"coherence.ttl=0",
28+
"java.net.preferIPv4Stack=true",
29+
"coherence.wka=127.0.0.1"
30+
}
31+
)
2532
@DirtiesContext
2633
class CoherenceOrderRepositoryIT {
2734
@Autowired

orders/src/test/java/com/oracle/coherence/examples/sockshop/spring/orders/CoherenceOrderResourceIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -37,7 +37,14 @@
3737
* Integration tests for {@link OrderController},
3838
* using Coherence for persistence.
3939
*/
40-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
40+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
41+
properties = {
42+
"coherence.localhost=127.0.0.1",
43+
"coherence.ttl=0",
44+
"java.net.preferIPv4Stack=true",
45+
"coherence.wka=127.0.0.1"
46+
}
47+
)
4148
@DirtiesContext
4249
public class CoherenceOrderResourceIT {
4350

orders/src/test/java/com/oracle/coherence/examples/sockshop/spring/orders/OrdersMetricsTests.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -45,6 +45,10 @@
4545
"management.tracing.sampling.probability=1.0",
4646
"coherence.metrics.http.enabled=true",
4747
"management.endpoints.web.exposure.include=*",
48+
"coherence.localhost=127.0.0.1",
49+
"coherence.ttl=0",
50+
"java.net.preferIPv4Stack=true",
51+
"coherence.wka=127.0.0.1"
4852
}
4953
)
5054
@AutoConfigureObservability

payment/src/test/java/com/oracle/coherence/examples/sockshop/spring/payment/PaymentMetricsTests.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -40,6 +40,10 @@
4040
@SpringBootTest(
4141
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
4242
properties = {
43+
"coherence.localhost=127.0.0.1",
44+
"coherence.ttl=0",
45+
"java.net.preferIPv4Stack=true",
46+
"coherence.wka=127.0.0.1",
4347
"management.tracing.sampling.probability=1.0",
4448
"coherence.metrics.http.enabled=true"
4549
}

payment/src/test/java/com/oracle/coherence/examples/sockshop/spring/payment/controller/CoherencePaymentResourceIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -12,6 +12,13 @@
1212
* Integration tests for {@link PaymentController},
1313
* using Coherence for persistence.
1414
*/
15-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
15+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
16+
properties = {
17+
"coherence.localhost=127.0.0.1",
18+
"coherence.ttl=0",
19+
"java.net.preferIPv4Stack=true",
20+
"coherence.wka=127.0.0.1"
21+
}
22+
)
1623
public class CoherencePaymentResourceIT extends PaymentResourceIT {
1724
}

payment/src/test/java/com/oracle/coherence/examples/sockshop/spring/payment/controller/PaymentResourceIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -31,7 +31,14 @@
3131
/**
3232
* Integration tests for {@link PaymentController}.
3333
*/
34-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
34+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
35+
properties = {
36+
"coherence.localhost=127.0.0.1",
37+
"coherence.ttl=0",
38+
"java.net.preferIPv4Stack=true",
39+
"coherence.wka=127.0.0.1"
40+
}
41+
)
3542
public class PaymentResourceIT {
3643

3744
@LocalServerPort

payment/src/test/java/com/oracle/coherence/examples/sockshop/spring/payment/repository/CoherencePaymentRepositoryIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -13,7 +13,14 @@
1313
/**
1414
* Tests for Coherence repository implementation.
1515
*/
16-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
16+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
17+
properties = {
18+
"coherence.localhost=127.0.0.1",
19+
"coherence.ttl=0",
20+
"java.net.preferIPv4Stack=true",
21+
"coherence.wka=127.0.0.1"
22+
}
23+
)
1724
class CoherencePaymentRepositoryIT extends PaymentRepositoryTest {
1825
@Autowired
1926
TestPaymentRepository testPaymentRepository;

shipping/src/test/java/com/oracle/coherence/examples/sockshop/spring/shipping/CoherenceShipmentRepositoryIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -13,7 +13,14 @@
1313
/**
1414
* Tests for Coherence repository implementation.
1515
*/
16-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
16+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
17+
properties = {
18+
"coherence.localhost=127.0.0.1",
19+
"coherence.ttl=0",
20+
"java.net.preferIPv4Stack=true",
21+
"coherence.wka=127.0.0.1"
22+
}
23+
)
1724
class CoherenceShipmentRepositoryIT extends ShipmentRepositoryTest {
1825
@Autowired
1926
TestShipmentRepository shipmentRepository;

shipping/src/test/java/com/oracle/coherence/examples/sockshop/spring/shipping/ShippingMetricsTests.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -41,6 +41,10 @@
4141
@SpringBootTest(
4242
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
4343
properties = {
44+
"coherence.localhost=127.0.0.1",
45+
"coherence.ttl=0",
46+
"java.net.preferIPv4Stack=true",
47+
"coherence.wka=127.0.0.1",
4448
"management.tracing.sampling.probability=1.0",
4549
"coherence.metrics.http.enabled=true"
4650
}

shipping/src/test/java/com/oracle/coherence/examples/sockshop/spring/shipping/ShippingResourceIT.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -29,7 +29,14 @@
2929
/**
3030
* Integration tests for {@link ShippingController}.
3131
*/
32-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
32+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
33+
properties = {
34+
"coherence.localhost=127.0.0.1",
35+
"coherence.ttl=0",
36+
"java.net.preferIPv4Stack=true",
37+
"coherence.wka=127.0.0.1"
38+
}
39+
)
3340
public class ShippingResourceIT {
3441

3542
@LocalServerPort

0 commit comments

Comments
 (0)