Skip to content

Commit d38e40b

Browse files
author
Ronald Holshausen
committed
fix the missing path method for additional interactions, updated example test
1 parent 8b7cc5a commit d38e40b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pact-jvm-consumer-junit/src/main/java/au/com/dius/pact/consumer/ConsumerPactBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ public PactDslRequestWithPath body(String body) {
140140
return this;
141141
}
142142

143+
public PactDslRequestWithPath path(String path) {
144+
this.path = path;
145+
return this;
146+
}
147+
143148
public PactDslResponse willRespondWith() {
144149
return new PactDslResponse(this);
145150
}

pact-jvm-consumer-junit/src/test/java/au/com/dius/pact/consumer/ExampleJavaConsumerPactTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ protected PactFragment createFragment(ConsumerPactBuilder.PactDslWithProvider bu
2727
.uponReceiving("a second test interaction")
2828
.method("OPTIONS")
2929
.headers(headers)
30+
.path("/second")
3031
.willRespondWith()
3132
.status(200)
3233
.headers(headers)
@@ -48,7 +49,7 @@ protected String consumerName() {
4849
@Override
4950
protected void runTest(String url) {
5051
try {
51-
assertEquals(new ConsumerClient(url).options("/"), 200);
52+
assertEquals(new ConsumerClient(url).options("/second"), 200);
5253
assertEquals(new ConsumerClient(url).get("/"), "{\"responsetest\":true}");
5354
} catch (Exception e) {
5455
throw new RuntimeException(e);

0 commit comments

Comments
 (0)