[Minor] Fix broken test

This commit is contained in:
Robert von Burg 2018-01-15 10:15:32 +01:00
parent c5e272eabd
commit 4de72bfe8b
1 changed files with 8 additions and 7 deletions

View File

@ -15,6 +15,7 @@
*/
package li.strolch.utils.objectfilter;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.*;
import java.util.List;
@ -100,7 +101,7 @@ public class ObjectFilterTest {
filter.add(myObj, myObj);
fail("Should have failed adding twice!");
} catch (RuntimeException e) {
assertEquals("Stale State exception: Invalid + after +", e.getMessage());
assertThat(e.getMessage(), containsString("Stale State exception: Invalid + after +"));
}
testAssertions(filter, 1, 1, 1, 0, 0);
@ -118,7 +119,7 @@ public class ObjectFilterTest {
filter.remove(myObj, myObj);
fail("Should have failed removing twice!");
} catch (RuntimeException e) {
assertEquals("Stale State exception: Invalid - after -", e.getMessage());
assertThat(e.getMessage(), containsString("Stale State exception: Invalid - after -"));
}
testAssertions(filter, 1, 1, 0, 0, 1);
@ -158,7 +159,7 @@ public class ObjectFilterTest {
filter.add(myObj, myObj);
fail("Should have failed add after modify");
} catch (RuntimeException e) {
assertEquals("Stale State exception: Invalid + after +=", e.getMessage());
assertThat(e.getMessage(), containsString("Stale State exception: Invalid + after +="));
}
testAssertions(filter, 1, 1, 0, 1, 0);
@ -186,7 +187,7 @@ public class ObjectFilterTest {
filter.update(myObj, myObj);
fail("Should have failed modify after remove");
} catch (RuntimeException e) {
assertEquals("Stale State exception: Invalid += after -", e.getMessage());
assertThat(e.getMessage(), containsString("Stale State exception: Invalid += after -"));
}
testAssertions(filter, 1, 1, 0, 0, 1);