File tree Expand file tree Collapse file tree 10 files changed +35
-18
lines changed
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 10 files changed +35
-18
lines changed Original file line number Diff line number Diff line change 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 -Dservice.name=customer-service
26+ run : mvn clean package -f customer-service/pom.xml -Dservice.name=customer-service pact:publish
2127
2228 - name : Build billing-service
2329 run : mvn clean package -f billing-service/pom.xml -Dservice.name=billing-service
2834 - name : Build address-validation-service
2935 run : mvn clean package -f address-validation-service/pom.xml -Dservice.name=address-validation-service
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:5000} " )
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:5000} " )
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 2626 <maven .compiler.target>17</maven .compiler.target>
2727 <failOnMissingWebXml >false</failOnMissingWebXml >
2828 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
29+ <pactBroker .url>http://localhost:5000</pactBroker .url>
2930 <meecrowave .version>1.2.15</meecrowave .version>
3031 <deltaspike .version>1.9.6</deltaspike .version>
3132 <junit .version>5.8.2</junit .version>
252253 </execution >
253254 </executions >
254255 </plugin >
256+ <plugin >
257+ <groupId >au.com.dius.pact.provider</groupId >
258+ <artifactId >maven</artifactId >
259+ <version >4.3.5</version >
260+ <configuration >
261+ <pactBrokerUrl >${pactBroker.url} </pactBrokerUrl >
262+ </configuration >
263+ </plugin >
255264 </plugins >
256265 </build >
257266</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 2626 <maven .compiler.target>17</maven .compiler.target>
2727 <failOnMissingWebXml >false</failOnMissingWebXml >
2828 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
29+ <pactBroker .url>http://localhost:5000</pactBroker .url>
2930 <meecrowave .version>1.2.15</meecrowave .version>
3031 <deltaspike .version>1.9.6</deltaspike .version>
3132 <hibernate .version>5.4.21.Final</hibernate .version>
226227 <configuration >
227228 <systemPropertyVariables >
228229 <pact .provider.version>${project.version} </pact .provider.version>
230+ <pactBroker .url>${pactBroker.url} </pactBroker .url>
229231 <javax .persistence.jdbc.url>jdbc:h2:mem:delivery</javax .persistence.jdbc.url>
230232 <javax .persistence.jdbc.driver>org.h2.Driver</javax .persistence.jdbc.driver>
231233 <javax .persistence.jdbc.user>sa</javax .persistence.jdbc.user>
266268 <artifactId >maven</artifactId >
267269 <version >4.3.5</version >
268270 <configuration >
269- <pactBrokerUrl >http://localhost:5000 </pactBrokerUrl >
271+ <pactBrokerUrl >${pactBroker.url} </pactBrokerUrl >
270272 </configuration >
271273 </plugin >
272274 </plugins >
Original file line number Diff line number Diff line change 3838import au .com .dius .pact .provider .junit5 .HttpTestTarget ;
3939import au .com .dius .pact .provider .junit5 .PactVerificationContext ;
4040import au .com .dius .pact .provider .junit5 .PactVerificationInvocationContextProvider ;
41+ import au .com .dius .pact .provider .junitsupport .IgnoreNoPactsToVerify ;
4142import au .com .dius .pact .provider .junitsupport .Provider ;
4243import au .com .dius .pact .provider .junitsupport .State ;
4344import au .com .dius .pact .provider .junitsupport .StateChangeAction ;
44- import au .com .dius .pact .provider .junitsupport .loader .PactFolder ;
45+ import au .com .dius .pact .provider .junitsupport .loader .PactBroker ;
4546import de .openknowledge .sample .address .domain .AddressValidationService ;
4647import rocks .limburg .cdimock .MockitoBeans ;
4748
49+ @ IgnoreNoPactsToVerify
4850@ MockitoBeans (types = {AddressValidationService .class })
4951@ Provider ("delivery-service" )
50- @ PactFolder ( "src/test/pacts " )
52+ @ PactBroker ( url = "${pactBroker.url:http://localhost:5000} " )
5153@ MonoMeecrowaveConfig
5254public class DeliveryAddressServiceTest {
5355
You can’t perform that action at this time.
0 commit comments