diff --git a/build.gradle b/build.gradle index 32a5b8d8..f1617d11 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ spotless { // 모든 Java 소스 파일에 포맷팅 규칙 적용 target("**/*.java") // google 자바 포맷 적용 - googleJavaFormat() + // 불필요한 임포트 제거 removeUnusedImports() // 마지막줄 New Line 처리 diff --git a/resource-server/src/test/java/com/inhabas/api/domain/budget/valueObject/ApplicantAccountTest.java b/resource-server/src/test/java/com/inhabas/api/domain/budget/valueObject/ApplicantAccountTest.java index 67abb45e..7c633d5e 100644 --- a/resource-server/src/test/java/com/inhabas/api/domain/budget/valueObject/ApplicantAccountTest.java +++ b/resource-server/src/test/java/com/inhabas/api/domain/budget/valueObject/ApplicantAccountTest.java @@ -1,12 +1,13 @@ package com.inhabas.api.domain.budget.valueObject; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + import com.inhabas.api.domain.budget.domain.valueObject.ApplicantAccount; + import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class ApplicantAccountTest { @DisplayName("Account 타입에 문자열을 저장한다.") @@ -29,21 +30,24 @@ public void tooLongApplicantAccountTest() { String accountString = "지금이문장은10자임".repeat(10); //then - assertThrows(IllegalArgumentException.class, - () -> new ApplicantAccount(accountString)); + assertThatThrownBy(() -> new ApplicantAccount(accountString)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage(null); } @DisplayName("계좌정보는 null 일 수 없습니다.") @Test public void applicantAccountCannotBeNull() { - assertThrows(IllegalArgumentException.class, - () -> new ApplicantAccount(null)); + assertThatThrownBy(() -> new ApplicantAccount(null)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage(null); } @DisplayName("계좌정보는 빈 문자열일 수 없습니다.") @Test public void applicantAccountCannotBeNullBlank() { - assertThrows(IllegalArgumentException.class, - () -> new ApplicantAccount("\t")); + assertThatThrownBy(() -> new ApplicantAccount("\t")) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage(null); } } diff --git a/resource-server/src/test/java/com/inhabas/api/domain/budget/valueObject/DetailTest.java b/resource-server/src/test/java/com/inhabas/api/domain/budget/valueObject/DetailTest.java index 73d0b303..f451b2bf 100644 --- a/resource-server/src/test/java/com/inhabas/api/domain/budget/valueObject/DetailTest.java +++ b/resource-server/src/test/java/com/inhabas/api/domain/budget/valueObject/DetailTest.java @@ -1,11 +1,12 @@ package com.inhabas.api.domain.budget.valueObject; import com.inhabas.api.domain.budget.domain.valueObject.Details; +import com.inhabas.api.domain.budget.domain.valueObject.RejectReason; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; public class DetailTest { @@ -29,21 +30,26 @@ public void tooLongDetailsTest() { String detailsString = "지금이문장은10자임".repeat(30); //then - assertThrows(IllegalArgumentException.class, - () -> new Details(detailsString)); + Assertions.assertThatThrownBy(() -> new Details(detailsString)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage(null); } @DisplayName("예산 내역 제목은 null 일 수 없습니다.") @Test public void detailsCannotBeNullTest() { - assertThrows(IllegalArgumentException.class, - () -> new Details(null)); + + Assertions.assertThatThrownBy(() -> new Details(null)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage(null); } @DisplayName("예산 상세내역 은 빈 문자열일 수 없습니다.") @Test public void detailsCannotBeBlankTest() { - assertThrows(IllegalArgumentException.class, - () -> new Details("\t")); + + Assertions.assertThatThrownBy(() -> new Details("\t")) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage(null); } }