File tree 3 files changed +33
-0
lines changed
provider/pact-jvm-provider-junit5-spring
kotlin/au/com/dius/pact/provider/spring/junit5
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,7 @@ dependencies {
2
2
implementation project(path : " :provider:pact-jvm-provider-junit5" , configuration : ' default' )
3
3
implementation ' org.springframework:spring-context:5.2.3.RELEASE'
4
4
implementation ' org.springframework:spring-test:5.2.3.RELEASE'
5
+
6
+ testImplementation ' org.springframework.boot:spring-boot-starter-test:2.2.5.RELEASE'
7
+ testImplementation ' org.springframework.boot:spring-boot-starter-web:2.2.5.RELEASE'
5
8
}
Original file line number Diff line number Diff line change
1
+ package au.com.dius.pact.provider.spring.junit5
2
+
3
+ import au.com.dius.pact.provider.junit.IgnoreNoPactsToVerify
4
+ import au.com.dius.pact.provider.junit.Provider
5
+ import au.com.dius.pact.provider.junit.loader.PactBroker
6
+ import au.com.dius.pact.provider.junit5.PactVerificationContext
7
+ import org.junit.jupiter.api.TestTemplate
8
+ import org.junit.jupiter.api.extension.ExtendWith
9
+ import org.springframework.boot.autoconfigure.SpringBootApplication
10
+ import org.springframework.boot.test.context.SpringBootTest
11
+ import org.springframework.test.context.junit.jupiter.SpringExtension
12
+
13
+ @SpringBootApplication
14
+ open class TestApplication
15
+
16
+ @ExtendWith(SpringExtension ::class )
17
+ @SpringBootTest(webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT )
18
+ @Provider(" Animal Profile Service" )
19
+ @PactBroker
20
+ @IgnoreNoPactsToVerify
21
+ internal class PactVerificationSpringProviderTest {
22
+ @TestTemplate
23
+ @ExtendWith(PactVerificationSpringProvider ::class )
24
+ fun pactVerificationTestTemplate (context : PactVerificationContext ? ) {
25
+ context?.verifyInteraction()
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ pactbroker :
2
+ host : localhost
3
+ port : ${local.server.port}
You can’t perform that action at this time.
0 commit comments