-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: validation 과정에서 NullPointException이 발생할 수 있는 버그 수정
- Loading branch information
1 parent
e817075
commit 398b278
Showing
5 changed files
with
28 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/java/com/playkuround/playkuroundserver/JavaTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.playkuround.playkuroundserver; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; | ||
|
||
public class JavaTest { | ||
|
||
@Test | ||
@DisplayName("Wrapper가 null일 때는 비교 연산자를 사용할 수 없다.(NullPointerException)") | ||
void wrapperTest() { | ||
Double value = null; | ||
|
||
assertThatThrownBy(() -> { | ||
boolean result = value <= 90.0; | ||
}).isInstanceOf(NullPointerException.class); | ||
|
||
assertThatThrownBy(() -> { | ||
boolean result = value == 90.0; | ||
}).isInstanceOf(NullPointerException.class); | ||
} | ||
} |