Delete redundant curly braces when using single lambda statement
This commit is contained in:
parent
f1801bbd6f
commit
0af6112abf
@ -9,9 +9,7 @@ class ExceptionAssertionUnitTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void whenExceptionThrown_thenAssertionSucceeds() {
|
void whenExceptionThrown_thenAssertionSucceeds() {
|
||||||
Exception exception = assertThrows(NumberFormatException.class, () -> {
|
Exception exception = assertThrows(NumberFormatException.class, () -> Integer.parseInt("1a"));
|
||||||
Integer.parseInt("1a");
|
|
||||||
});
|
|
||||||
|
|
||||||
String expectedMessage = "For input string";
|
String expectedMessage = "For input string";
|
||||||
String actualMessage = exception.getMessage();
|
String actualMessage = exception.getMessage();
|
||||||
@ -21,9 +19,7 @@ class ExceptionAssertionUnitTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void whenDerivedExceptionThrown_thenAssertionSucceds() {
|
void whenDerivedExceptionThrown_thenAssertionSucceds() {
|
||||||
Exception exception = assertThrows(RuntimeException.class, () -> {
|
Exception exception = assertThrows(RuntimeException.class, () -> Integer.parseInt("1a"));
|
||||||
Integer.parseInt("1a");
|
|
||||||
});
|
|
||||||
|
|
||||||
String expectedMessage = "For input string";
|
String expectedMessage = "For input string";
|
||||||
String actualMessage = exception.getMessage();
|
String actualMessage = exception.getMessage();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user