diff --git a/src/test/java/com/eactive/apim/portal/apps/agreements/controller/AgreementsControllerTest.java b/src/test/java/com/eactive/apim/portal/apps/agreements/controller/AgreementsControllerTest.java index c334bd8..1f7576e 100644 --- a/src/test/java/com/eactive/apim/portal/apps/agreements/controller/AgreementsControllerTest.java +++ b/src/test/java/com/eactive/apim/portal/apps/agreements/controller/AgreementsControllerTest.java @@ -6,6 +6,7 @@ import com.eactive.apim.portal.apps.agreements.dto.AgreementTabDTO; import com.eactive.apim.portal.apps.agreements.dto.AgreementsDTO; import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade; import java.time.LocalDateTime; +import java.time.Month; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -21,6 +22,7 @@ import org.springframework.ui.ExtendedModelMap; import org.springframework.ui.Model; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -98,8 +100,8 @@ class AgreementsControllerTest { @Test @DisplayName("tab 이 없으면 노출 목록의 첫 번째 약관을 연다") void showTerms_defaultsToFirstDisplayType() { - AgreementsDTO latest = agreement("이용약관 v2", LocalDateTime.of(2026, 3, 1, 0, 0)); - AgreementsDTO older = agreement("이용약관 v1", LocalDateTime.of(2025, 1, 1, 0, 0)); + AgreementsDTO latest = agreement("이용약관 v2", LocalDateTime.of(2026, Month.MARCH, 1, 0, 0)); + AgreementsDTO older = agreement("이용약관 v1", LocalDateTime.of(2025, Month.JANUARY, 1, 0, 0)); when(agreementTypeConfigService.getDisplayTypes()).thenReturn(Arrays.asList( AgreementType.TERMS_OF_USE, AgreementType.NOTIFICATION_CONSENT)); @@ -119,13 +121,13 @@ class AgreementsControllerTest { assertEquals(Arrays.asList("terms", "notification"), tabs.stream().map(AgreementTabDTO::getTab).collect(Collectors.toList())); assertTrue(tabs.get(0).isActive()); - assertEquals(false, tabs.get(1).isActive()); + assertFalse(tabs.get(1).isActive()); } @Test @DisplayName("tab 슬러그가 노출 목록에 있으면 그 약관을 연다") void showTerms_selectsRequestedTab() { - AgreementsDTO notification = agreement("알림 수신 동의서", LocalDateTime.of(2026, 2, 1, 0, 0)); + AgreementsDTO notification = agreement("알림 수신 동의서", LocalDateTime.of(2026, Month.FEBRUARY, 1, 0, 0)); when(agreementTypeConfigService.getDisplayTypes()).thenReturn(Arrays.asList( AgreementType.TERMS_OF_USE, AgreementType.NOTIFICATION_CONSENT)); @@ -139,14 +141,14 @@ class AgreementsControllerTest { assertEquals(AgreementType.NOTIFICATION_CONSENT.getCode(), model.getAttribute("agreementType")); List tabs = tabs(); - assertEquals(false, tabs.get(0).isActive()); + assertFalse(tabs.get(0).isActive()); assertTrue(tabs.get(1).isActive()); } @Test @DisplayName("노출 목록에 없는 tab 은 첫 번째 탭으로 보정한다") void showTerms_unknownTabFallsBackToFirst() { - AgreementsDTO privacyCollect = agreement("개인정보수집동의서", LocalDateTime.of(2026, 1, 5, 0, 0)); + AgreementsDTO privacyCollect = agreement("개인정보수집동의서", LocalDateTime.of(2026, Month.JANUARY, 5, 0, 0)); // notification 은 노출 대상이 아니다 when(agreementTypeConfigService.getDisplayTypes()) @@ -164,7 +166,7 @@ class AgreementsControllerTest { @Test @DisplayName("빈 tab 문자열도 첫 번째 탭으로 보정한다") void showTerms_emptyTabFallsBackToFirst() { - AgreementsDTO terms = agreement("이용약관", LocalDateTime.of(2026, 1, 1, 0, 0)); + AgreementsDTO terms = agreement("이용약관", LocalDateTime.of(2026, Month.JANUARY, 1, 0, 0)); when(agreementTypeConfigService.getDisplayTypes()) .thenReturn(Collections.singletonList(AgreementType.TERMS_OF_USE)); @@ -180,8 +182,8 @@ class AgreementsControllerTest { @Test @DisplayName("publishedOn 이 주어지면 해당 제정일의 개정본을 고른다") void showTerms_picksAgreementByPublishedOn() { - AgreementsDTO latest = agreement("v2", LocalDateTime.of(2026, 3, 1, 9, 30)); - AgreementsDTO older = agreement("v1", LocalDateTime.of(2025, 1, 15, 0, 0)); + AgreementsDTO latest = agreement("v2", LocalDateTime.of(2026, Month.MARCH, 1, 9, 30)); + AgreementsDTO older = agreement("v1", LocalDateTime.of(2025, Month.JANUARY, 15, 0, 0)); when(agreementTypeConfigService.getDisplayTypes()) .thenReturn(Collections.singletonList(AgreementType.TERMS_OF_USE)); @@ -197,7 +199,7 @@ class AgreementsControllerTest { @Test @DisplayName("일치하는 제정일이 없으면 첫 항목으로 되돌린다") void showTerms_unmatchedPublishedOnFallsBackToFirst() { - AgreementsDTO latest = agreement("v2", LocalDateTime.of(2026, 3, 1, 0, 0)); + AgreementsDTO latest = agreement("v2", LocalDateTime.of(2026, Month.MARCH, 1, 0, 0)); when(agreementTypeConfigService.getDisplayTypes()) .thenReturn(Collections.singletonList(AgreementType.TERMS_OF_USE)); diff --git a/src/test/java/com/eactive/apim/portal/apps/user/UserRegisterControllerAgreementTest.java b/src/test/java/com/eactive/apim/portal/apps/user/UserRegisterControllerAgreementTest.java index 3398525..89a6c22 100644 --- a/src/test/java/com/eactive/apim/portal/apps/user/UserRegisterControllerAgreementTest.java +++ b/src/test/java/com/eactive/apim/portal/apps/user/UserRegisterControllerAgreementTest.java @@ -143,7 +143,7 @@ class UserRegisterControllerAgreementTest { assertEquals("apps/register/userRegister", view); assertEquals("personal", model.getAttribute("registrationType")); - assertEquals(false, model.getAttribute("isInvited")); + assertEquals(Boolean.FALSE, model.getAttribute("isInvited")); assertAgreementSettingsApplied(); }