| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final T | |
| private final List | |
| private final List | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | describeTo(Description
The description to be built or appended to. description)Implements org. |
| private boolean | |
| private boolean | |
| private boolean | |
| private static boolean | |
| protected boolean | matches(Object actual, Description mismatch)
Implements abstract org. |
| private static <T> List | |
| private static Set | |
| private static Object | |
| public static <B> Matcher | samePropertyValuesAs(B
the bean against which examined beans are compared expectedBean, String... do not check any of these named properties. ignoredProperties)Creates a matcher that matches when the examined object has values for all of its JavaBean properties that are equal to the corresponding values of the specified bean. |
| expectedBean | back to summary |
|---|---|
| private final T expectedBean | |
| ignoredFields | back to summary |
|---|---|
| private final List<String> ignoredFields | |
| propertyMatchers | back to summary |
|---|---|
| private final List<SamePropertyValuesAs. | |
| propertyNames | back to summary |
|---|---|
| private final Set<String> propertyNames | |
| SamePropertyValuesAs | back to summary |
|---|---|
public SamePropertyValuesAs(T expectedBean, List<String> ignoredProperties)
| |
| describeTo | back to summary |
|---|---|
| public void describeTo(Description description) Implements org. Doc from org. Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.
| |
| hasMatchingValues | back to summary |
|---|---|
| private boolean hasMatchingValues(Object actual, Description mismatchDescription) | |
| hasNoExtraProperties | back to summary |
|---|---|
| private boolean hasNoExtraProperties(Object actual, Description mismatchDescription) | |
| isCompatibleType | back to summary |
|---|---|
| private boolean isCompatibleType(Object actual, Description mismatchDescription) | |
| isIgnored | back to summary |
|---|---|
| private static boolean isIgnored(List<String> ignoredFields, PropertyDescriptor propertyDescriptor) | |
| matches | back to summary |
|---|---|
| protected boolean matches(Object actual, Description mismatch) Implements abstract org.
| |
| propertyMatchersFor | back to summary |
|---|---|
| private static <T> List | |
| propertyNamesFrom | back to summary |
|---|---|
| private static Set | |
| readProperty | back to summary |
|---|---|
| private static Object readProperty(Method method, Object target) | |
| samePropertyValuesAs | back to summary |
|---|---|
| public static <B> Matcher Creates a matcher that matches when the examined object has values for all of its JavaBean properties that are equal to the corresponding values of the specified bean. If any properties are marked as ignored, they will be dropped from both the expected and actual bean. Note that the ignored properties use JavaBean display names, for example agerather than method names such as getAge. For example: assertThat(myBean, samePropertyValuesAs(myExpectedBean)) assertThat(myBean, samePropertyValuesAs(myExpectedBean), "age", "height")
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Matcher | |
| private final String | |
| private final Method |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | describeTo(Description
The description to be built or appended to. description)Implements org. |
| public boolean | matches(Object actual, Description mismatch)
Implements abstract org. |
| matcher | back to summary |
|---|---|
| private final Matcher<Object> matcher | |
| propertyName | back to summary |
|---|---|
| private final String propertyName | |
| readMethod | back to summary |
|---|---|
| private final Method readMethod | |
| PropertyMatcher | back to summary |
|---|---|
| public PropertyMatcher(PropertyDescriptor descriptor, Object expectedObject) | |
| describeTo | back to summary |
|---|---|
| public void describeTo(Description description) Implements org. Doc from org. Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.
| |
| matches | back to summary |
|---|---|
| public boolean matches(Object actual, Description mismatch) Implements abstract org.
| |