Permalink
Browse files

Use allOf() instead of both() to avoid type parameter

  • Loading branch information...
marcphilipp committed Jul 19, 2012
1 parent 1489b8e commit 2d886e29734f9f55b75db91095880c5d109ff678
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/test/java/org/junit/tests/running/methods/AnnotationTest.java
@@ -1,5 +1,6 @@
package org.junit.tests.running.methods;
+import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
@@ -8,7 +9,6 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.hamcrest.CoreMatchers;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -143,10 +143,7 @@ public void testTestAndTeardownFailure() throws Exception {
Result runner= core.run(TestAndTeardownFailureTest.class);
assertEquals(1, runner.getRunCount());
assertEquals(2, runner.getFailureCount());
- assertThat(
- runner.getFailures().toString(),
- CoreMatchers.<String> both(containsString("hereAfter")).and(
- containsString("inTest")));
+ assertThat(runner.getFailures().toString(), allOf(containsString("hereAfter"), containsString("inTest")));
}
static public class TeardownAfterFailureTest {

0 comments on commit 2d886e2

Please sign in to comment.