/** * 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 built using the Pact body DSL */ public PactDslResponse body(DslPart body) { DslPart parent = body.close(); if (parent instanceof PactDslJsonRootValue) { ((PactDslJsonRootValue)parent).setEncodeJson(true); } responseMatchers.addCategory(parent.getMatchers()); responseGenerators.addGenerators(parent.generators); if (parent.getBody() != null) { responseBody = OptionalBody.body(parent.getBody().toString()); } else { responseBody = OptionalBody.nullBody(); } 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 built using the Pact body DSL */ public PactDslResponse body(DslPart body) { DslPart parent = body.close(); if (parent instanceof PactDslJsonRootValue) { ((PactDslJsonRootValue)parent).setEncodeJson(true); } responseMatchers.addCategory(parent.getMatchers()); responseGenerators.addGenerators(parent.generators); if (parent.getBody() != null) { responseBody = OptionalBody.body(parent.getBody().toString()); } else { responseBody = OptionalBody.nullBody(); } if (!responseHeaders.containsKey(CONTENT_TYPE)) { matchHeader(CONTENT_TYPE, DEFAULT_JSON_CONTENT_TYPE_REGEX, ContentType.APPLICATION_JSON.toString()); } 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; }
/** * 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; }
/** * 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 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 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 Response body in Java Functional Interface Supplier that must return a string */ public PactDslResponse body(Supplier<String> body) { responseBody = 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 Response body in Java Functional Interface Supplier that must return a string */ public PactDslResponse body(Supplier<String> body) { responseBody = 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 string form */ public PactDslRequestWithPath body(String body, String mimeType) { requestBody = OptionalBody.body(body); requestHeaders.put(CONTENT_TYPE, mimeType); return this; }