diff --git a/backend/src/main/java/wooteco/prolog/member/domain/Part.java b/backend/src/main/java/wooteco/prolog/member/domain/Part.java index 36cf9e6a1..d8ac61840 100644 --- a/backend/src/main/java/wooteco/prolog/member/domain/Part.java +++ b/backend/src/main/java/wooteco/prolog/member/domain/Part.java @@ -27,7 +27,7 @@ public static Part getPartByName(String name) { return Arrays.stream(values()) .filter(part -> part.name.equals(name)) .findFirst() - .orElseThrow(() -> new IllegalArgumentException()); + .orElseThrow(() -> new IllegalArgumentException("name과 일치하는 part가 존재하지 않습니다.")); } } diff --git a/backend/src/test/java/wooteco/prolog/member/domain/DepartmentTest.java b/backend/src/test/java/wooteco/prolog/member/domain/DepartmentTest.java index 638cb356e..bc11dc350 100644 --- a/backend/src/test/java/wooteco/prolog/member/domain/DepartmentTest.java +++ b/backend/src/test/java/wooteco/prolog/member/domain/DepartmentTest.java @@ -22,7 +22,6 @@ class DepartmentTest { @Test void getPartType_이름이_포함하는_그룹명이_없으면_예외가_발생한다() { - assertThatThrownBy(() -> new Department(null, "테스트", "test")) .isInstanceOf(IllegalArgumentException.class) .hasMessage("name과 일치하는 part가 존재하지 않습니다.");