@Override public boolean matches(Object obj) { try { for (SupportedClass supportedClass : SupportedClass.values()) { if (isOfType(obj, supportedClass.getClassName())) { return true; } } return false; } catch (Exception e) { return false; } }
public static Matcher<CharSequence> matchesPattern(String regex) { return new ContainsPattern(regex, true); }
public void assertMessageBodyContainsPathOfType(String path, String type) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, ofType(type))); }
@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)))); }
public void assertMessageBodyContainsPathMatchingPattern(String path, String pattern) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, containsPattern(pattern))); }
public void assertMessageBodyContainsPathWithOtherValue(String path, String value) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, notEqualToIgnoringType(value))); }
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 assertMessageBodyContainsArrayWithEntryHavingValue(String path, String value) { boolean caseInsensitive = globalWorldFacade.getBoolean("case-insensitive"); assertThat(message, containsValueByPathInArray(MessageWrapperContentProvider.INSTANCE, path, equalToIgnoringType(value, caseInsensitive))); }
@Override public boolean matches(Object o) { this.value = retrieveValueByPath(contentProvider, o, path); if (this.value instanceof List) { List list = (List) this.value; return matchObjectInArray(list.toArray()); } else if (this.value instanceof Object[]) { return matchObjectInArray((Object[]) this.value); } else { return false; } }
@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)))); }
public void assertMessageBodyContainsPathNotMatchingPattern(String path, String pattern) { assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, not(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 bodyContainsPathOfType(String path, String type) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), OfTypeMatcher.ofType(type))); }
@Override public void bodyContainsArrayWithSize(String path, String size) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), ArrayWithSizeMatcher.arrayWithSize(size))); }
public static Matcher<CharSequence> matchesPattern(Pattern p) { return new ContainsPattern(p, true); }
@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))); }
public static Matcher<CharSequence> containsPattern(String regex) { return new ContainsPattern(regex, false); }
@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))))); }