You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the consumer test does the following:
private static final String alpacaBody = " {\n" +
" \"colour\": \"black\",\n" +
" \"name\": \"floppy\"\n" +
" }";
...
// Here we define our mock, which is also our expectations for the provider
return builder.given("test GET")
.uponReceiving("GET REQUEST")
.path("/alpaca")
.method("GET")
.willRespondWith()
.status(200)
.headers(headers)
.body(alpacaBody)
.toPact(V4Pact.class);
That should always work, but it would be nice to be able to do
private static final Alpaca alpaca = new Alpaca("black", "floppy");
...
// Here we define our mock, which is also our expectations for the provider
return builder.given("test GET")
.uponReceiving("GET REQUEST")
.path("/alpaca")
.method("GET")
.willRespondWith()
.status(200)
.headers(headers)
.body(alpaca)
.toPact(V4Pact.class);
That works with Rest Assured. This would probably be a change to feed back to the Pact library, perhaps by allowing it to be initialised with an object mapper and then us auto-magically handing over the object mapper?
Alternatively, we should include some tests which manually inject the object mapper and create the json. There's no extension-specific magic, but it's a useful example to be able to follow.
The text was updated successfully, but these errors were encountered:
At the moment, the consumer test does the following:
That should always work, but it would be nice to be able to do
That works with Rest Assured. This would probably be a change to feed back to the Pact library, perhaps by allowing it to be initialised with an object mapper and then us auto-magically handing over the object mapper?
Alternatively, we should include some tests which manually inject the object mapper and create the json. There's no extension-specific magic, but it's a useful example to be able to follow.
The text was updated successfully, but these errors were encountered: