Added NPE guard when there are no bytes returned
This commit is contained in:
@@ -57,10 +57,13 @@ public abstract class WireMockVerifyHelper<T, S extends WireMockVerifyHelper<T,
|
|||||||
|
|
||||||
public void configure(T result) {
|
public void configure(T result) {
|
||||||
Map<String, Object> configuration = getConfiguration(result);
|
Map<String, Object> configuration = getConfiguration(result);
|
||||||
String actual = new String(getRequestBodyContent(result),
|
byte[] requestBodyContent = getRequestBodyContent(result);
|
||||||
Charset.forName("UTF-8"));
|
if (requestBodyContent != null) {
|
||||||
for (JsonPath jsonPath : this.jsonPaths.values()) {
|
String actual = new String(requestBodyContent,
|
||||||
new JsonPathValue(jsonPath, actual).assertHasValue(Object.class, "an object");
|
Charset.forName("UTF-8"));
|
||||||
|
for (JsonPath jsonPath : this.jsonPaths.values()) {
|
||||||
|
new JsonPathValue(jsonPath, actual).assertHasValue(Object.class, "an object");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
configuration.put("contract.jsonPaths", this.jsonPaths.keySet());
|
configuration.put("contract.jsonPaths", this.jsonPaths.keySet());
|
||||||
if (this.contentType != null) {
|
if (this.contentType != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user