Group testing modules (#3014)
* move security content from spring-security-rest-full * swagger update * move query language to new module * rename spring-security-rest-full to spring-rest-full * group persistence modules * group testing modules * try fix conflict
This commit is contained in:
committed by
GitHub
parent
b383d83bf4
commit
776a01429e
@@ -0,0 +1,28 @@
|
||||
package com.baeldung;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class AssertionUnitTest {
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user