With JUnit4 you could e.g. just write:
@Test (expectedException = new UnsupportedOperationException()){...}
How is this possible in JUnit5? I tried this way, but I'm not sure if this is equal.
@Test
public void testExpectedException() {
Assertions.assertThrows(UnsupportedOperationException.class, () -> {
Integer.parseInt("One");});
Aucun commentaire:
Enregistrer un commentaire