@Pact(provider="Appointment_Provider",consumer = "Appointment_Consumer") public PactFragment createFragmentAppointmentDetails(PactDslWithProvider 构建器)抛出 ParseException{
Map<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/json");
return builder
.given("GetAppoinment")
.uponReceiving("Get Appointment information")
.path("/getappointment")
.query("apptId=11207")
.method("GET")
.willRespondWith()
.headers(headers)
.status(200)
.body(new PactDslJsonBody()
.object("appointments")
.stringValue("type","Test \\u0026 Turn up")
.stringValue("apptId","11207")
.closeObject()
)
.toFragment()
;
}