Skip to content

Commit 63c3e94

Browse files
committed
fix: correct message key expectations in UserActionControllerTest
Update test assertions to match actual TokenValidationResult.getValue() return values. The enum uses camelCase values (invalidToken, expired) but tests were expecting uppercase or snake_case variations.
1 parent 30ce976 commit 63c3e94

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/test/java/com/digitalsanctuary/spring/user/controller/UserActionControllerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ void showChangePasswordPage_invalidToken_redirectsToIndexWithError() throws Exce
129129
mockMvc.perform(get("/user/changePassword")
130130
.param("token", token))
131131
.andExpect(status().is3xxRedirection())
132-
.andExpect(redirectedUrl("/index.html?messageKey=auth.message.invalid_token"))
133-
.andExpect(model().attribute("messageKey", "auth.message.invalid_token"));
132+
.andExpect(redirectedUrl("/index.html?messageKey=auth.message.invalidToken"))
133+
.andExpect(model().attribute("messageKey", "auth.message.invalidToken"));
134134
}
135135

136136
@Test
@@ -187,7 +187,7 @@ void confirmRegistration_expiredToken_redirectsToNewVerification() throws Except
187187
mockMvc.perform(get("/user/registrationConfirm")
188188
.param("token", token))
189189
.andExpect(status().is3xxRedirection())
190-
.andExpect(redirectedUrl("/user/request-new-verification-email.html?lang=en&messageKey=auth.message.EXPIRED&expired=true&token=" + token))
190+
.andExpect(redirectedUrl("/user/request-new-verification-email.html?lang=en&messageKey=auth.message.expired&expired=true&token=" + token))
191191
.andExpect(model().attribute("expired", true))
192192
.andExpect(model().attribute("token", token));
193193

@@ -207,7 +207,7 @@ void confirmRegistration_invalidToken_redirectsToNewVerification() throws Except
207207
mockMvc.perform(get("/user/registrationConfirm")
208208
.param("token", token))
209209
.andExpect(status().is3xxRedirection())
210-
.andExpect(redirectedUrl("/user/request-new-verification-email.html?lang=en&messageKey=auth.message.INVALID_TOKEN&expired=false&token=" + token))
210+
.andExpect(redirectedUrl("/user/request-new-verification-email.html?lang=en&messageKey=auth.message.invalidToken&expired=false&token=" + token))
211211
.andExpect(model().attribute("expired", false))
212212
.andExpect(model().attribute("token", token));
213213
}

0 commit comments

Comments
 (0)