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