@Override protected boolean matchesSafely(Response response) { //containsValueByPath return containsValueByPath(new JsonMatchers.ContentProvider<Response>() { @Override public String getValue(Object o) { return ((Response) o).getBody().asString(); } @Override public String getContentType(Object o) { return ((Response) o).getContentType(); } }, path, matcher).matches(response); }
public void assertMessageBodyContainsArrayWithEntryHavingValue(String path, String value) { boolean caseInsensitive = globalWorldFacade.getBoolean("case-insensitive"); assertThat(message, containsValueByPathInArray(MessageWrapperContentProvider.INSTANCE, path, equalToIgnoringType(value, caseInsensitive))); }
@Override public void bodyContainsArrayWithObjectHavingProperty(String path, String property, String value) { Response response = this.facade.response(); assertThat(response, containsPropertyValueByPathInArray(ResponseContentProvider.INSTANCE, getPath(path), property, equalToIgnoringType(value, this.world.getBoolean("case-insensitive"))) ); }
@Override public void bodyContainsArrayWithObjectHavingProperty(String path, String property, String value) { Response response = this.facade.response(); assertThat(response, containsPropertyValueByPathInArray(ResponseContentProvider.INSTANCE, getPath(path), property, equalToIgnoringType(value, this.world.getBoolean("case-insensitive"))) ); }
@Override protected boolean matchesSafely(Response response) { //containsValueByPath return containsValueByPath(new JsonMatchers.ContentProvider<Response>() { @Override public String getValue(Object o) { return ((Response) o).getBody().asString(); } @Override public String getContentType(Object o) { return ((Response) o).getContentType(); } }, path, matcher).matches(response); }
@Override public void bodyContainsArrayWithEntryHavingValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPathInArray(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
public void assertMessageBodyDoesNotContainPath(String path) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, nullValue())); }
@Override public void bodyContainsArrayWithEntryHavingValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPathInArray(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
public void assertMessageContainsPropertyWithPhrase(String path, String phrase) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, containsString(phrase))); }
public void assertMessageBodyContainsPathWithOtherValue(String path, String value) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, notEqualToIgnoringType(value))); }
public void assertMessageBodyContainsPathMatchingPattern(String path, String pattern) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, containsPattern(pattern))); }
public void assertMessageBodyContainsPathOfType(String path, String type) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, ofType(type))); }
public void assertMessageBodyContainsArrayWithSize(String path, String operator, Integer size) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, arrayWithSize(operator + size))); }
public void assertMessageContainsPropertyWithValue(String path, String value) { boolean caseInsensitive = globalWorldFacade.getBoolean("case-insensitive"); assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, equalToIgnoringType(value, caseInsensitive))); }
public void assertMessageBodyContainsPathNotMatchingPattern(String path, String pattern) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, not(containsPattern(pattern)))); } }
@Override public void bodyContainsJsonPathValueContainingPhrase(String path, String phrase) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), containsString(phrase))); }
@Override public void bodyContainsJsonPathValueContainingPhrase(String path, String phrase) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), containsString(phrase))); }
@Override public void bodyContainsPathNotMatchingPattern(String path, String pattern) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), MiscMatchers.that(Matchers.not(ContainsPattern.containsPattern(pattern))))); }
@Override public void bodyContainsPathNotMatchingPattern(String path, String pattern) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), MiscMatchers.that(Matchers.not(ContainsPattern.containsPattern(pattern))))); }
@Override public void bodyContainsArrayWithSize(String path, String size) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), ArrayWithSizeMatcher.arrayWithSize(size))); }