@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 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 assertMessageBodyContainsPathOfType(String path, String type) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, ofType(type))); }
public void assertMessageBodyContainsPathWithOtherValue(String path, String value) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, notEqualToIgnoringType(value))); }
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 bodyContainsPathWithOtherValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.notEqualToIgnoringType(value))); }
@Override public void bodyContainsArrayWithSize(String path, String size) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), ArrayWithSizeMatcher.arrayWithSize(size))); }
@Override public void bodyContainsPathWithOtherValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.notEqualToIgnoringType(value))); }
@Override public void bodyContainsArrayWithSize(String path, String size) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), ArrayWithSizeMatcher.arrayWithSize(size))); }
@Override public void bodyContainsPathOfType(String path, String type) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), OfTypeMatcher.ofType(type))); }
@Override public void bodyContainsPathOfType(String path, String type) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), OfTypeMatcher.ofType(type))); }
@Override public void bodyContainsPathWithValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
@Override public void bodyContainsPathMatchingPattern(String path, String pattern) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), MiscMatchers.that(ContainsPattern.containsPattern(pattern)))); }
@Override public void bodyContainsPathMatchingPattern(String path, String pattern) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), MiscMatchers.that(ContainsPattern.containsPattern(pattern)))); }
@Override public void bodyContainsPathWithValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }