Skip to content

Commit

Permalink
fix: null 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
shindong96 committed Oct 9, 2024
1 parent d94d797 commit fda20ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum EmploymentType {
;

public static EmploymentType from(String value) {
if (value.isBlank()) {
if (value == null || value.isBlank()) {
return UNDEFINED;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ void getValue_if_UNDEFINED() {
// when & then
assertThat(employmentType.getValue()).isNull();
}

@DisplayName("null이 들어오는경우 UNDEFINED 반환")
@Test
void makeEmploymentByNull() {
// given & when & then
assertThat(EmploymentType.from(null)).isEqualTo(EmploymentType.UNDEFINED);
}
}

0 comments on commit fda20ca

Please sign in to comment.