diff --git a/build.gradle b/build.gradle index 579296c..09a7d66 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id "java" id "org.springframework.boot" version "3.0.0" id "io.spring.dependency-management" version "1.1.0" + id "au.com.dius.pact" version "4.4.2" } group = 'de.rpr' @@ -26,3 +27,21 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +pact { + + publish { + // empty, but needs to be there + } + + broker { + pactBrokerUrl = "http://localhost:9292" + } + + serviceProviders { + + UserServiceJUnit5 { + // empty + } + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..b30519c --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +pact.verifier.publishResults=true \ No newline at end of file diff --git a/src/test/java/de/rpr/pactexample/PactConsumerJUnit5Test.java b/src/test/java/de/rpr/pactexample/PactConsumerJUnit5Test.java index f154bf1..98e7c50 100644 --- a/src/test/java/de/rpr/pactexample/PactConsumerJUnit5Test.java +++ b/src/test/java/de/rpr/pactexample/PactConsumerJUnit5Test.java @@ -1,14 +1,11 @@ package de.rpr.pactexample; import au.com.dius.pact.consumer.MockServer; -import au.com.dius.pact.consumer.PactTestExecutionContext; import au.com.dius.pact.consumer.dsl.PactBuilder; import au.com.dius.pact.consumer.dsl.PactDslJsonArray; import au.com.dius.pact.consumer.dsl.PactDslJsonBody; -import au.com.dius.pact.consumer.dsl.PactDslWithProvider; import au.com.dius.pact.consumer.junit5.PactConsumerTestExt; import au.com.dius.pact.consumer.junit5.PactTestFor; -import au.com.dius.pact.core.model.RequestResponsePact; import au.com.dius.pact.core.model.V4Pact; import au.com.dius.pact.core.model.annotations.Pact; import org.junit.jupiter.api.Test; @@ -17,7 +14,6 @@ import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.web.client.RestTemplate; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/src/test/java/de/rpr/pactexample/PactProviderJUnit5WithBrokerTest.java b/src/test/java/de/rpr/pactexample/PactProviderJUnit5WithBrokerTest.java index f40738b..e2eb7f4 100644 --- a/src/test/java/de/rpr/pactexample/PactProviderJUnit5WithBrokerTest.java +++ b/src/test/java/de/rpr/pactexample/PactProviderJUnit5WithBrokerTest.java @@ -18,7 +18,6 @@ import org.springframework.boot.test.web.server.LocalServerPort; @PactBroker(url = "http://localhost:9292") @SetSystemProperty.SetSystemProperties({ @SetSystemProperty(key = "pact.verifier.publishResults", value = "true"), - @SetSystemProperty(key = "pact.provider.version", value = "current") }) public class PactProviderJUnit5WithBrokerTest {