更新项目的目录结构
This commit is contained in:
+17
-6
@@ -8,9 +8,14 @@ import org.junit.jupiter.api.TestInstance;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
|
||||
/**
|
||||
* String format to number with NumberFormatException
|
||||
*
|
||||
* @author YuCheng
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_METHOD)
|
||||
public class NumberFormatExceptionTest {
|
||||
|
||||
@@ -20,16 +25,22 @@ public class NumberFormatExceptionTest {
|
||||
|
||||
@Test
|
||||
public void ConstructorNumberFormatException() {
|
||||
Exception exception = assertThrows(NumberFormatException.class, () -> {
|
||||
|
||||
// Exception exception = assertThrows(NumberFormatException.class, () -> {
|
||||
// new Integer("one");
|
||||
// });
|
||||
|
||||
assertThatThrownBy(() -> {
|
||||
new Integer("one");
|
||||
});
|
||||
}).isInstanceOf(NumberFormatException.class).hasMessageStartingWith("For input string");
|
||||
|
||||
System.out.println(exception);
|
||||
// System.out.println(exception);
|
||||
|
||||
Integer aIntegerObj = new Integer("one");
|
||||
Integer aIntegerObj = new Integer("1");
|
||||
|
||||
// Integer aIntegerObj = new Integer("one");
|
||||
Double doubleDecimalObj = new Double("two.2");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user