Yasin 1e6f0da46a BAEL-926 Upgrade Junit 5 dependencies to use M4 (#1802)
* BAEL-88 Testing in Spring Boot

* BAEL-88 Integration tests fixed.

* BAEL-905 Improvement task for spring boot testing

* BAEL-905 Improvement task for spring boot testing

* BAEL-926 Upgrade Junit 5 dependencies to use M4
2017-05-07 19:41:55 +02:00

29 lines
531 B
Java

package com.baeldung;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;
public class AssertionTest {
@Test
public void testConvertToDoubleThrowException() {
String age = "eighteen";
assertThrows(NumberFormatException.class, () -> {
convertToInt(age);
});
assertThrows(NumberFormatException.class, () -> {
convertToInt(age);
});
}
private static Integer convertToInt(String str) {
if (str == null) {
return null;
}
return Integer.valueOf(str);
}
}