Consistent ordering of Assert variants

Issue: SPR-15196
This commit is contained in:
Juergen Hoeller
2017-02-16 15:32:07 +01:00
parent 0922943c12
commit f90cd7705f
2 changed files with 231 additions and 219 deletions

View File

@@ -43,6 +43,37 @@ public class AssertTests {
public final ExpectedException thrown = ExpectedException.none();
@Test
public void stateWithMessage() {
Assert.state(true, "enigma");
}
@Test
public void stateWithFalseExpressionAndMessage() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("enigma");
Assert.state(false, "enigma");
}
@Test
public void stateWithMessageSupplier() {
Assert.state(true, () -> "enigma");
}
@Test
public void stateWithFalseExpressionAndMessageSupplier() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("enigma");
Assert.state(false, () -> "enigma");
}
@Test
public void stateWithFalseExpressionAndNullMessageSupplier() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage(equalTo(null));
Assert.state(false, (Supplier<String>) null);
}
@Test
public void isTrueWithMessage() {
Assert.isTrue(true, "enigma");
@@ -637,23 +668,4 @@ public class AssertTests {
Assert.state(false, "enigma");
}
@Test
public void stateWithMessageSupplier() {
Assert.state(true, () -> "enigma");
}
@Test
public void stateWithFalseExpressionAndMessageSupplier() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("enigma");
Assert.state(false, () -> "enigma");
}
@Test
public void stateWithFalseExpressionAndNullMessageSupplier() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage(equalTo(null));
Assert.state(false, (Supplier<String>) null);
}
}