diff --git a/src/test/java/com/eactive/apim/portal/apps/user/AccountControllerTest.java b/src/test/java/com/eactive/apim/portal/apps/user/AccountControllerTest.java index c60ffbf..c5f6a2f 100644 --- a/src/test/java/com/eactive/apim/portal/apps/user/AccountControllerTest.java +++ b/src/test/java/com/eactive/apim/portal/apps/user/AccountControllerTest.java @@ -2,6 +2,8 @@ package com.eactive.apim.portal.apps.user; import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade; +import com.eactive.apim.portal.apps.auth.twofactor.TwoFactorProperties; +import com.eactive.apim.portal.apps.auth.twofactor.TwoFactorService; import com.eactive.apim.portal.apps.session.service.UserSessionService; import com.eactive.apim.portal.apps.user.controller.AccountController; import com.eactive.apim.portal.apps.user.dto.PortalUserDTO; @@ -61,6 +63,12 @@ class AccountControllerTest { @Mock private UserSessionService userSessionService; + @Mock + private TwoFactorService twoFactorService; + + @Mock + private TwoFactorProperties twoFactorProperties; + @InjectMocks private AccountController accountController; @@ -73,7 +81,7 @@ class AccountControllerTest { @Test void testShowChangePasswordPage() throws Exception { - mockMvc.perform(get("/change_password")) + mockMvc.perform(get("/password/verify")) .andExpect(status().isOk()) .andExpect(view().name("apps/mypage/passwordChangeEntry")) .andExpect(model().attributeExists("passwordChangeRequest")); @@ -84,7 +92,7 @@ class AccountControllerTest { try (MockedStatic securityUtil = mockStatic(SecurityUtil.class)) { securityUtil.when(SecurityUtil::getCurrentLoginId).thenReturn("testUser"); - mockMvc.perform(post("/mypage/change_new_password") + mockMvc.perform(post("/password/change") .param("newPassword", "NewPass!1") .param("confirmPassword", "NewPass!1")) .andExpect(status().is3xxRedirection()) @@ -99,7 +107,7 @@ class AccountControllerTest { doThrow(new IllegalArgumentException("invalid password")) .when(userFacade).updatePassword(eq("testUser"), anyString(), anyString()); - mockMvc.perform(post("/mypage/change_new_password") + mockMvc.perform(post("/password/change") .param("newPassword", "NewPass!1") .param("confirmPassword", "Different!1")) .andExpect(status().isOk())