|
1 | 1 | package io.quarkiverse.pact.devmodetest.farm;
|
2 | 2 |
|
| 3 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 4 | +import static org.junit.jupiter.api.Assertions.assertNotNull; |
| 5 | + |
| 6 | +import java.util.HashMap; |
| 7 | +import java.util.Map; |
| 8 | + |
| 9 | +import org.eclipse.microprofile.rest.client.inject.RestClient; |
| 10 | +import org.junit.jupiter.api.Disabled; |
| 11 | +import org.junit.jupiter.api.Test; |
| 12 | +import org.junit.jupiter.api.extension.ExtendWith; |
| 13 | + |
3 | 14 | import au.com.dius.pact.consumer.MockServer;
|
4 | 15 | import au.com.dius.pact.consumer.dsl.PactDslWithProvider;
|
5 | 16 | import au.com.dius.pact.consumer.junit5.PactConsumerTestExt;
|
|
11 | 22 | import io.quarkiverse.pact.testapp.ConsumerAlpaca;
|
12 | 23 | import io.quarkiverse.pact.testapp.Knitter;
|
13 | 24 | import io.quarkus.test.junit.QuarkusTest;
|
14 |
| -import org.eclipse.microprofile.rest.client.inject.RestClient; |
15 |
| -import org.junit.jupiter.api.Test; |
16 |
| -import org.junit.jupiter.api.extension.ExtendWith; |
17 |
| - |
18 |
| -import javax.inject.Inject; |
19 |
| -import java.util.HashMap; |
20 |
| -import java.util.Map; |
21 |
| - |
22 |
| -import static org.junit.jupiter.api.Assertions.assertEquals; |
23 |
| -import static org.junit.jupiter.api.Assertions.assertNotNull; |
| 25 | +import jakarta.inject.Inject; |
24 | 26 |
|
25 | 27 | @ExtendWith(PactConsumerTestExt.class)
|
26 | 28 | @PactTestFor(providerName = "farm", port = "8085")
|
@@ -80,6 +82,8 @@ public void testContractLooksCorrect() {
|
80 | 82 | }
|
81 | 83 |
|
82 | 84 | @Test
|
| 85 | + @Disabled // With Quarkus 3, test methods cannot directly access Pact classes, because they are in different classloaders. See https://github.com/quarkiverse/quarkus-pact/issues/73 |
| 86 | + // The good news is there are very few use cases where test code should be doing parameter injection of the mock server. |
83 | 87 | public void testPortIsCorrect(MockServer mockServer) {
|
84 | 88 | // If we have a test, pact assumes we will call it and validates there was a call
|
85 | 89 | ConsumerAlpaca alpaca = alpacaService.getByName("fluffy");
|
|
0 commit comments