Skip to content

Commit

Permalink
Add integration test access not logged in
Browse files Browse the repository at this point in the history
RISDEV-6410
  • Loading branch information
SebastianRossa committed Feb 14, 2025
1 parent 4da4a7c commit 1e78c8c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.bund.digitalservice.ris.norms.integration;

import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

Expand All @@ -24,10 +23,10 @@ void noAccessIfNotLoggedIn() throws Exception {
}

@Test
void userShouldBeRedirectedOnLogout() throws Exception {
void userShouldBeRedirectedToLogin() throws Exception {
// when
mvc
.perform(get("/logout").with(user("user")).accept(MediaType.TEXT_HTML))
.perform(get("/amending-laws").accept(MediaType.TEXT_HTML))
// then
.andExpect(status().is3xxRedirection());
}
Expand Down

0 comments on commit 1e78c8c

Please sign in to comment.