File tree Expand file tree Collapse file tree
address-validation-service
src/test/java/de/openknowledge/sample/address
src/test/java/de/openknowledge/sample/address
src/test/java/de/openknowledge/sample/address Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,23 +16,23 @@ jobs:
1616 distribution : ' temurin'
1717 cache : maven
1818
19+ - name : Build with Docker
20+ run : docker compose build
21+
22+ - name : Start with Docker
23+ run : docker compose up -d
24+
1925 - name : Build customer-service
20- run : mvn clean package -f customer-service/pom.xml
26+ run : mvn clean package -f customer-service/pom.xml pact:publish
2127
2228 - name : Build billing-service
2329 run : mvn clean package -f billing-service/pom.xml
2430
2531 - name : Build delivery-service
26- run : mvn clean package -f delivery-service/pom.xml
32+ run : mvn clean package -f delivery-service/pom.xml pact:publish
2733
2834 - name : Build address-validation-service
2935 run : mvn clean package -f address-validation-service/pom.xml
3036
31- - name : Build with Docker
32- run : docker compose build
33-
34- - name : Start with Docker
35- run : docker compose up -d
36-
3737 - name : Stop Docker Containers
3838 run : docker compose down
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ pipeline {
4848 }
4949 }
5050 steps {
51- sh " mvn test -B"
51+ sh " mvn test -DpactBroker.url=http://pact:9292 -Dpact.verifier.publishResults=true - B"
5252 }
5353 }
5454 stage (' Package' ) {
Original file line number Diff line number Diff line change 2727import au .com .dius .pact .provider .junit5 .HttpTestTarget ;
2828import au .com .dius .pact .provider .junit5 .PactVerificationContext ;
2929import au .com .dius .pact .provider .junit5 .PactVerificationInvocationContextProvider ;
30+ import au .com .dius .pact .provider .junitsupport .IgnoreNoPactsToVerify ;
3031import au .com .dius .pact .provider .junitsupport .Provider ;
3132import au .com .dius .pact .provider .junitsupport .State ;
32- import au .com .dius .pact .provider .junitsupport .loader .PactFolder ;
33+ import au .com .dius .pact .provider .junitsupport .loader .PactBroker ;
3334
35+ @ IgnoreNoPactsToVerify
3436@ Provider ("address-validation-service" )
35- @ PactFolder ( "src/test/pacts " )
37+ @ PactBroker ( url = "${pactBroker.url:http://localhost:5050} " )
3638@ MonoMeecrowaveConfig
3739public class AddressValidationServiceTest {
3840
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ pipeline {
4848 }
4949 }
5050 steps {
51- sh " mvn test -B"
51+ sh " mvn test -DpactBroker.url=http://pact:9292 -Dpact.verifier.publishResults=true - B"
5252 }
5353 }
5454 stage (' Package' ) {
Original file line number Diff line number Diff line change 2727import au .com .dius .pact .provider .junit5 .HttpTestTarget ;
2828import au .com .dius .pact .provider .junit5 .PactVerificationContext ;
2929import au .com .dius .pact .provider .junit5 .PactVerificationInvocationContextProvider ;
30+ import au .com .dius .pact .provider .junitsupport .IgnoreNoPactsToVerify ;
3031import au .com .dius .pact .provider .junitsupport .Provider ;
3132import au .com .dius .pact .provider .junitsupport .State ;
32- import au .com .dius .pact .provider .junitsupport .loader .PactFolder ;
33+ import au .com .dius .pact .provider .junitsupport .loader .PactBroker ;
3334
35+ @ IgnoreNoPactsToVerify
3436@ Provider ("billing-service" )
35- @ PactFolder ( "src/test/pacts " )
37+ @ PactBroker ( url = "${pactBroker.url:http://localhost:5050} " )
3638@ MonoMeecrowaveConfig
3739public class BillingAddressServiceTest {
3840
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ pipeline {
4848 }
4949 }
5050 steps {
51- sh " mvn test -B "
51+ sh ' mvn test pact:publish -DpactBroker.url=http://pact:9292 -B '
5252 }
5353 }
5454 stage (' Package' ) {
Original file line number Diff line number Diff line change 1919 <maven .compiler.target>17</maven .compiler.target>
2020 <failOnMissingWebXml >false</failOnMissingWebXml >
2121 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
22+ <pactBroker .url>http://localhost:5050</pactBroker .url>
2223 <meecrowave .version>2.0.0</meecrowave .version>
2324 <deltaspike .version>1.9.6</deltaspike .version>
2425 <junit .version>5.8.2</junit .version>
202203 </execution >
203204 </executions >
204205 </plugin >
206+ <plugin >
207+ <groupId >au.com.dius.pact.provider</groupId >
208+ <artifactId >maven</artifactId >
209+ <version >4.3.5</version >
210+ <configuration >
211+ <pactBrokerUrl >${pactBroker.url} </pactBrokerUrl >
212+ </configuration >
213+ </plugin >
205214 </plugins >
206215 </build >
207216</project >
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ pipeline {
4848 }
4949 }
5050 steps {
51- sh " mvn test -B"
51+ sh " mvn test pact:publish -DpactBroker.url=http://pact:9292 -Dpact.verifier.publishResults=true -B"
5252 }
5353 }
5454 stage (' Package' ) {
Original file line number Diff line number Diff line change 1919 <maven .compiler.target>17</maven .compiler.target>
2020 <failOnMissingWebXml >false</failOnMissingWebXml >
2121 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
22+ <pactBroker .url>http://localhost:5050</pactBroker .url>
2223 <meecrowave .version>2.0.0</meecrowave .version>
2324 <deltaspike .version>1.9.6</deltaspike .version>
2425 <hibernate .version>7.2.2.Final</hibernate .version>
175176 <configuration >
176177 <systemPropertyVariables >
177178 <pact .provider.version>${project.version} </pact .provider.version>
179+ <pactBroker .url>${pactBroker.url} </pactBroker .url>
178180 <jakarta .persistence.jdbc.url>jdbc:h2:mem:delivery</jakarta .persistence.jdbc.url>
179181 <jakarta .persistence.jdbc.driver>org.h2.Driver</jakarta .persistence.jdbc.driver>
180182 <jakarta .persistence.jdbc.user>sa</jakarta .persistence.jdbc.user>
215217 <artifactId >maven</artifactId >
216218 <version >4.3.5</version >
217219 <configuration >
218- <pactBrokerUrl >http://localhost:5050 </pactBrokerUrl >
220+ <pactBrokerUrl >${pactBroker.url} </pactBrokerUrl >
219221 </configuration >
220222 </plugin >
221223 </plugins >
Original file line number Diff line number Diff line change 4141import au .com .dius .pact .provider .junit5 .HttpTestTarget ;
4242import au .com .dius .pact .provider .junit5 .PactVerificationContext ;
4343import au .com .dius .pact .provider .junit5 .PactVerificationInvocationContextProvider ;
44+ import au .com .dius .pact .provider .junitsupport .IgnoreNoPactsToVerify ;
4445import au .com .dius .pact .provider .junitsupport .Provider ;
4546import au .com .dius .pact .provider .junitsupport .State ;
4647import au .com .dius .pact .provider .junitsupport .StateChangeAction ;
47- import au .com .dius .pact .provider .junitsupport .loader .PactFolder ;
48+ import au .com .dius .pact .provider .junitsupport .loader .PactBroker ;
4849import de .openknowledge .sample .address .domain .AddressValidationService ;
4950import rocks .limburg .cdimock .MockitoBeans ;
5051
52+ @ IgnoreNoPactsToVerify
5153@ MockitoBeans (types = {AddressValidationService .class })
5254@ Provider ("delivery-service" )
53- @ PactFolder ( "src/test/pacts " )
55+ @ PactBroker ( url = "${pactBroker.url:http://localhost:5050} " )
5456@ MonoMeecrowaveConfig
5557public class DeliveryAddressServiceTest {
5658
You can’t perform that action at this time.
0 commit comments