Skip to content

Commit

Permalink
Use allOf() instead of both() to avoid type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Jul 19, 2012
1 parent 1489b8e commit 2d886e2
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2d886e2

Please sign in to comment.