From 4575ec73d6e9adfe58704e307d9c5d1cce82a66a Mon Sep 17 00:00:00 2001 From: wonyongChoi05 Date: Thu, 23 Nov 2023 17:11:48 +0900 Subject: [PATCH] fix: error message --- backend/src/main/java/wooteco/prolog/member/domain/Part.java | 2 +- .../test/java/wooteco/prolog/member/domain/DepartmentTest.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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가 존재하지 않습니다.");