[Minor] Fix broken test
This commit is contained in:
parent
c5e272eabd
commit
4de72bfe8b
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
* Copyright 2013 Robert von Burg <eitch@eitchnet.ch>
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue