@Test @PactVerification public void verify() throws Exception { final JsonConsumer consumer = new JsonConsumer(mockProvider.getUrl()); final String result = consumer.greet("Michael"); assertEquals("{\"greeting\":\"Hello, Michael!\"}", result); }
public String greet(String name) { return target.path("/greet") .request(APPLICATION_JSON) .post( entity("{ \"name\": \"" + name + "\" }", APPLICATION_JSON), String.class); }
JsonConsumer { public String greet(String name) { return target.path("/greet") .request(APPLICATION_JSON) .post( entity("{ \"name\": \"" + name + "\" }", APPLICATION_JSON), String.class); } }
JsonConsumer { public String greet(String name) { return target.path("/greet") .request(APPLICATION_JSON) .post( entity("{ \"name\": \"" + name + "\" }", APPLICATION_JSON), String.class); } JsonConsumer(String uri); private  JsonConsumer(String uri, Client client); private  JsonConsumer(WebTarget target); }
JsonConsumer { public String greet(String name) { return target.path("/greet") .request(APPLICATION_JSON) .post( entity("{ \"name\": \"" + name + "\" }", APPLICATION_JSON), String.class); } JsonConsumer(String uri); private  JsonConsumer(String uri, Client client); private  JsonConsumer(WebTarget target); String greet(String name); }
JsonConsumer { public String greet(String name) { return target.path("/greet") .request(APPLICATION_JSON) .post( entity("{ \"name\": \"" + name + "\" }", APPLICATION_JSON), String.class); } JsonConsumer(String uri); private  JsonConsumer(String uri, Client client); private  JsonConsumer(WebTarget target); String greet(String name);  }