Skip to content

Commit c39a881

Browse files
committed
Factory methods. Bean has same property values
1 parent 4fd60a9 commit c39a881

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
lines changed

hamcrest-library/src/main/java/org/hamcrest/Matchers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ public static <T> Matcher<T> hasProperty(java.lang.String propertyName, org.hamc
14511451
* @param expectedBean the bean against which examined beans are compared
14521452
*/
14531453
public static <T> Matcher<T> samePropertyValuesAs(T expectedBean) {
1454-
return org.hamcrest.beans.SamePropertyValuesAs.samePropertyValuesAs(expectedBean);
1454+
return MatchingBeans.samePropertyValuesAs(expectedBean);
14551455
}
14561456

14571457
/**

hamcrest-library/src/main/java/org/hamcrest/beans/MatchingBeans.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static <T> org.hamcrest.Matcher<T> hasProperty(java.lang.String propertyN
3636
* @param expectedBean the bean against which examined beans are compared
3737
*/
3838
public static <T> org.hamcrest.Matcher<T> samePropertyValuesAs(T expectedBean) {
39-
return org.hamcrest.beans.SamePropertyValuesAs.samePropertyValuesAs(expectedBean);
39+
return new SamePropertyValuesAs<>(expectedBean);
4040
}
4141

4242
}

hamcrest-library/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,4 @@ private static Object readProperty(Method method, Object target) {
123123
}
124124
}
125125

126-
/**
127-
* Creates a matcher that matches when the examined object has values for all of
128-
* its JavaBean properties that are equal to the corresponding values of the
129-
* specified bean.
130-
* For example:
131-
* <pre>assertThat(myBean, samePropertyValuesAs(myExpectedBean))</pre>
132-
*
133-
* @param expectedBean
134-
* the bean against which examined beans are compared
135-
*/
136-
public static <T> Matcher<T> samePropertyValuesAs(T expectedBean) {
137-
return new SamePropertyValuesAs<>(expectedBean);
138-
}
139-
140126
}

hamcrest-library/src/test/java/org/hamcrest/beans/SamePropertyValuesAsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.hamcrest.AbstractMatcherTest;
66
import org.hamcrest.Matcher;
77

8-
import static org.hamcrest.beans.SamePropertyValuesAs.samePropertyValuesAs;
8+
import static org.hamcrest.beans.MatchingBeans.samePropertyValuesAs;
99

1010
@SuppressWarnings("UnusedDeclaration")
1111
public class SamePropertyValuesAsTest extends AbstractMatcherTest {

0 commit comments

Comments
 (0)