Skip to content

Commit 5ac1d98

Browse files
committed
adding pact runner
1 parent e679367 commit 5ac1d98

File tree

6 files changed

+45
-5
lines changed

6 files changed

+45
-5
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ jobs:
66
- image: 'cimg/openjdk:8.0'
77
steps:
88
- checkout
9+
- run:
10+
name: Run Pact Broker
11+
command: docker-compose up -v
912
- run:
1013
name: Analyze on SonarCloud
1114
command: mvn verify sonar:sonar
15+
- run:
16+
name: Run Pact Broker
17+
command: docker-compose down -v
1218

1319
executors:
1420
j8:

docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: "3"
2+
3+
services:
4+
postgres:
5+
image: postgres
6+
healthcheck:
7+
test: psql postgres --command "select 1" -U postgres
8+
volumes:
9+
- postgres-volume:/var/lib/postgresql/data
10+
environment:
11+
POSTGRES_USER: postgres
12+
POSTGRES_PASSWORD: password
13+
POSTGRES_DB: postgres
14+
15+
pact-broker:
16+
image: pactfoundation/pact-broker:2.105.0.1
17+
ports:
18+
- "9292:9292"
19+
depends_on:
20+
- postgres
21+
environment:
22+
PACT_BROKER_PORT: '9292'
23+
PACT_BROKER_DATABASE_URL: "postgres://postgres:password@postgres/postgres"
24+
PACT_BROKER_LOG_LEVEL: INFO
25+
PACT_BROKER_SQL_LOG_LEVEL: DEBUG
26+
PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES: "5"
27+
PACT_BROKER_BASE_URL: 'https://localhost http://localhost http://localhost:9292 http://pact-broker:9292 https://host.docker.internal http://host.docker.internal http://host.docker.internal:9292'
28+
29+
volumes:
30+
postgres-volume:

driver-management/src/test/java/pl/piomin/services/driver/contract/DriverControllerContractTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
@RunWith(SpringRestPactRunner.class)
2323
@Provider("driverManagementProvider")
24-
@PactBroker
24+
@PactBroker(host = "localhost", port = "9292")
2525
public class DriverControllerContractTests {
2626

2727
@InjectMocks
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
pactbroker:
2-
host: "192.168.99.100"
3-
port: "8090"
2+
host: "localhost"
3+
port: "9292"
4+
protocol: "http"
5+
auth:
6+
username: ""
7+
password: ""

passenger-management/src/test/java/pl/piomin/services/passenger/PassengerControllerContractTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
@RunWith(SpringRestPactRunner.class)
2121
@Provider("passengerManagementProvider")
22-
@PactBroker(host = "192.168.99.100", port = "9080")
22+
@PactBroker(host = "localhost", port = "9292")
2323
public class PassengerControllerContractTests {
2424

2525
@InjectMocks

trip-management/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<artifactId>pact-jvm-provider-maven_2.12</artifactId>
7171
<version>3.5.21</version>
7272
<configuration>
73-
<pactBrokerUrl>http://192.168.99.100:9080</pactBrokerUrl>
73+
<pactBrokerUrl>http://localhost:9292</pactBrokerUrl>
7474
<!--<serviceProviders>-->
7575
<!--<serviceProvider>-->
7676
<!--<name>passengerManagementProvider</name>-->

0 commit comments

Comments
 (0)