|
13 | 13 | */
|
14 | 14 | public class EasyMock2Adapter implements IArgumentMatcher {
|
15 | 15 |
|
16 |
| - /** |
17 |
| - * Convenience factory method that will adapt a |
18 |
| - * Hamcrest {@link org.hamcrest.Matcher} to act as an |
19 |
| - * EasyMock {@link org.easymock.IArgumentMatcher} and |
20 |
| - * report it to EasyMock so it can be kept track of. |
21 |
| - */ |
22 |
| - public static IArgumentMatcher adapt(Matcher<?> matcher) { |
23 |
| - EasyMock2Adapter easyMock2Matcher = new EasyMock2Adapter(matcher); |
24 |
| - EasyMock.reportMatcher(easyMock2Matcher); |
25 |
| - return easyMock2Matcher; |
26 |
| - } |
| 16 | + /** |
| 17 | + * Convenience factory method that will adapt a |
| 18 | + * Hamcrest {@link org.hamcrest.Matcher} to act as an |
| 19 | + * EasyMock {@link org.easymock.IArgumentMatcher} and |
| 20 | + * report it to EasyMock so it can be kept track of. |
| 21 | + */ |
| 22 | + public static IArgumentMatcher adapt(Matcher<?> matcher) { |
| 23 | + EasyMock2Adapter easyMock2Matcher = new EasyMock2Adapter(matcher); |
| 24 | + EasyMock.reportMatcher(easyMock2Matcher); |
| 25 | + return easyMock2Matcher; |
| 26 | + } |
27 | 27 |
|
28 |
| - private final Matcher<?> hamcrestMatcher; |
| 28 | + private final Matcher<?> hamcrestMatcher; |
29 | 29 |
|
30 |
| - public EasyMock2Adapter(Matcher<?> matcher) { |
31 |
| - this.hamcrestMatcher = matcher; |
32 |
| - } |
| 30 | + public EasyMock2Adapter(Matcher<?> matcher) { |
| 31 | + this.hamcrestMatcher = matcher; |
| 32 | + } |
33 | 33 |
|
34 |
| - @Override |
35 |
| - public boolean matches(Object argument) { |
36 |
| - return hamcrestMatcher.matches(argument); |
37 |
| - } |
| 34 | + @Override |
| 35 | + public boolean matches(Object argument) { |
| 36 | + return hamcrestMatcher.matches(argument); |
| 37 | + } |
38 | 38 |
|
39 |
| - @Override |
40 |
| - public void appendTo(StringBuffer buffer) { |
41 |
| - hamcrestMatcher.describeTo(new StringDescription(buffer)); |
42 |
| - } |
| 39 | + @Override |
| 40 | + public void appendTo(StringBuffer buffer) { |
| 41 | + hamcrestMatcher.describeTo(new StringDescription(buffer)); |
| 42 | + } |
43 | 43 | }
|
0 commit comments