Integrating with pact broker
This commit is contained in:
parent
d82129fed0
commit
44d2871d3d
4 changed files with 20 additions and 5 deletions
19
build.gradle
19
build.gradle
|
@ -2,6 +2,7 @@ plugins {
|
||||||
id "java"
|
id "java"
|
||||||
id "org.springframework.boot" version "3.0.0"
|
id "org.springframework.boot" version "3.0.0"
|
||||||
id "io.spring.dependency-management" version "1.1.0"
|
id "io.spring.dependency-management" version "1.1.0"
|
||||||
|
id "au.com.dius.pact" version "4.4.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'de.rpr'
|
group = 'de.rpr'
|
||||||
|
@ -26,3 +27,21 @@ dependencies {
|
||||||
tasks.named('test') {
|
tasks.named('test') {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pact {
|
||||||
|
|
||||||
|
publish {
|
||||||
|
// empty, but needs to be there
|
||||||
|
}
|
||||||
|
|
||||||
|
broker {
|
||||||
|
pactBrokerUrl = "http://localhost:9292"
|
||||||
|
}
|
||||||
|
|
||||||
|
serviceProviders {
|
||||||
|
|
||||||
|
UserServiceJUnit5 {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
1
gradle.properties
Normal file
1
gradle.properties
Normal file
|
@ -0,0 +1 @@
|
||||||
|
pact.verifier.publishResults=true
|
|
@ -1,14 +1,11 @@
|
||||||
package de.rpr.pactexample;
|
package de.rpr.pactexample;
|
||||||
|
|
||||||
import au.com.dius.pact.consumer.MockServer;
|
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.PactBuilder;
|
||||||
import au.com.dius.pact.consumer.dsl.PactDslJsonArray;
|
import au.com.dius.pact.consumer.dsl.PactDslJsonArray;
|
||||||
import au.com.dius.pact.consumer.dsl.PactDslJsonBody;
|
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.PactConsumerTestExt;
|
||||||
import au.com.dius.pact.consumer.junit5.PactTestFor;
|
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.V4Pact;
|
||||||
import au.com.dius.pact.core.model.annotations.Pact;
|
import au.com.dius.pact.core.model.annotations.Pact;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -17,7 +14,6 @@ import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.springframework.boot.test.web.server.LocalServerPort;
|
||||||
@PactBroker(url = "http://localhost:9292")
|
@PactBroker(url = "http://localhost:9292")
|
||||||
@SetSystemProperty.SetSystemProperties({
|
@SetSystemProperty.SetSystemProperties({
|
||||||
@SetSystemProperty(key = "pact.verifier.publishResults", value = "true"),
|
@SetSystemProperty(key = "pact.verifier.publishResults", value = "true"),
|
||||||
@SetSystemProperty(key = "pact.provider.version", value = "current")
|
|
||||||
})
|
})
|
||||||
public class PactProviderJUnit5WithBrokerTest {
|
public class PactProviderJUnit5WithBrokerTest {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue