/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithPath body(String body) { requestBody = OptionalBody.body(body); return this; }
/** * Response body to return * * @param body Response body in string form */ public PactDslResponse body(String body) { this.responseBody = OptionalBody.body(body); return this; }
/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithPath body(String body) { requestBody = OptionalBody.body(body); return this; }
/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithoutPath body(String body) { requestBody = OptionalBody.body(body); return this; }
/** * The body of the request * * @param body Request body in Java Functional Interface Supplier that must return a string */ public PactDslRequestWithPath body(Supplier<String> body) { requestBody = OptionalBody.body(body.get()); return this; }
/** * The body of the request * * @param body Request body in Java Functional Interface Supplier that must return a string */ public PactDslRequestWithoutPath body(Supplier<String> body) { requestBody = OptionalBody.body(body.get()); return this; }
/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithoutPath body(String body, String mimeType) { requestBody = OptionalBody.body(body); requestHeaders.put(CONTENT_TYPE, mimeType); return this; }
/** * The body of the request * * @param body Request body in Java Functional Interface Supplier that must return a string */ public PactDslRequestWithoutPath body(Supplier<String> body) { requestBody = OptionalBody.body(body.get()); return this; }
/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithPath body(String body, String mimeType) { requestBody = OptionalBody.body(body); requestHeaders.put(CONTENT_TYPE, mimeType); return this; }
/** * The body of the request * * @param body Request body in Java Functional Interface Supplier that must return a string */ public PactDslRequestWithPath body(Supplier<String> body) { requestBody = OptionalBody.body(body.get()); return this; }
/** * Response body to return * * @param body body in string form * @param mimeType the Content-Type response header value */ public PactDslResponse body(String body, String mimeType) { responseBody = OptionalBody.body(body); responseHeaders.put(CONTENT_TYPE, mimeType); return this; }
/** * The body of the request * * @param body Request body in Java Functional Interface Supplier that must return a string */ public PactDslRequestWithPath body(Supplier<String> body, String mimeType) { requestBody = OptionalBody.body(body.get()); requestHeaders.put(CONTENT_TYPE, mimeType); return this; }
/** * The body of the request * * @param body Response body in Java Functional Interface Supplier that must return a string * @param mimeType the Content-Type response header value */ public PactDslResponse body(Supplier<String> body, String mimeType) { responseBody = OptionalBody.body(body.get()); responseHeaders.put(CONTENT_TYPE, mimeType); return this; }
/** * The body of the request * * @param body Request body in Java Functional Interface Supplier that must return a string */ public PactDslRequestWithPath body(Supplier<String> body, String mimeType) { requestBody = OptionalBody.body(body.get()); requestHeaders.put(CONTENT_TYPE, mimeType); return this; }
/** * The body of the request * * @param body Request body in JSON form */ public PactDslRequestWithoutPath body(JSONObject body) { requestBody = OptionalBody.body(body.toString()); if (!requestHeaders.containsKey(CONTENT_TYPE)) { requestHeaders.put(CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()); } return this; }
/** * The body of the request * * @param body Request body in JSON form */ public PactDslRequestWithoutPath body(JSONObject body) { requestBody = OptionalBody.body(body.toString()); if (!requestHeaders.containsKey(CONTENT_TYPE)) { requestHeaders.put(CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()); } return this; }
/** * The body of the request * * @param body XML Document */ public PactDslRequestWithoutPath body(Document body) throws TransformerException { requestBody = OptionalBody.body(xmlToString(body)); if (!requestHeaders.containsKey(CONTENT_TYPE)) { requestHeaders.put(CONTENT_TYPE, ContentType.APPLICATION_XML.toString()); } return this; }
/** * Response body to return * * @param body Response body in JSON form */ public PactDslResponse body(JSONObject body) { this.responseBody = OptionalBody.body(body.toString()); if (!responseHeaders.containsKey(CONTENT_TYPE)) { matchHeader(CONTENT_TYPE, DEFAULT_JSON_CONTENT_TYPE_REGEX, ContentType.APPLICATION_JSON.toString()); } return this; }
/** * Response body to return * * @param body Response body as an XML Document */ public PactDslResponse body(Document body) throws TransformerException { responseBody = OptionalBody.body(ConsumerPactBuilder.xmlToString(body)); if (!responseHeaders.containsKey(CONTENT_TYPE)) { responseHeaders.put(CONTENT_TYPE, ContentType.APPLICATION_XML.toString()); } return this; }
/** * Response body to return * * @param body Response body in JSON form */ public PactDslResponse body(JSONObject body) { this.responseBody = OptionalBody.body(body.toString()); if (!responseHeaders.containsKey(CONTENT_TYPE)) { matchHeader(CONTENT_TYPE, DEFAULT_JSON_CONTENT_TYPE_REGEX, ContentType.APPLICATION_JSON.toString()); } return this; }