public class HasPath<T>
extends org.hamcrest.TypeSafeDiagnosingMatcher<T>
| Constructor and Description |
|---|
HasPath(String path,
org.hamcrest.Matcher<?> matcher) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(org.hamcrest.Description description) |
static <T> org.hamcrest.Matcher<T> |
hasPath(String path,
org.hamcrest.Matcher<?> matcher)
Creates a matcher that matches if the object being tested has a property at the given path and it matches the Matcher
For example:
|
protected boolean |
matchesSafely(T item,
org.hamcrest.Description mismatchDescription) |
public HasPath(String path, org.hamcrest.Matcher<?> matcher)
public static <T> org.hamcrest.Matcher<T> hasPath(String path, org.hamcrest.Matcher<?> matcher)
MyObject instance = new MyObject();
assertThat(instance, hasPath("MyObject.Person.Name", Matchers.equalTo("Jane"))
path - the path to matchpublic void describeTo(org.hamcrest.Description description)
Copyright © 2015. All rights reserved.