Skip to content

Commit 072b7de

Browse files
committed
Use 'this.' for field access
Signed-off-by: Josh Cummings <[email protected]>
1 parent 1d7a964 commit 072b7de

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

complete/src/test/java/com/example/securingweb/SecuringWebApplicationTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,30 @@ class SecuringWebApplicationTests {
2929
void loginWithValidUserThenAuthenticated() throws Exception {
3030
FormLoginRequestBuilder login = formLogin().user("user").password("password");
3131

32-
mockMvc.perform(login).andExpect(authenticated().withUsername("user"));
32+
this.mockMvc.perform(login).andExpect(authenticated().withUsername("user"));
3333
}
3434

3535
@Test
3636
void loginWithInvalidUserThenUnauthenticated() throws Exception {
3737
FormLoginRequestBuilder login = formLogin().user("invalid").password("invalidpassword");
3838

39-
mockMvc.perform(login).andExpect(unauthenticated());
39+
this.mockMvc.perform(login).andExpect(unauthenticated());
4040
}
4141

4242
@Test
4343
void accessUnsecuredResourceThenOk() throws Exception {
44-
mockMvc.perform(get("/")).andExpect(status().isOk());
44+
this.mockMvc.perform(get("/")).andExpect(status().isOk());
4545
}
4646

4747
@Test
4848
void accessSecuredResourceUnauthenticatedThenRedirectsToLogin() throws Exception {
49-
mockMvc.perform(get("/hello")).andExpect(status().is3xxRedirection()).andExpect(redirectedUrl("/login"));
49+
this.mockMvc.perform(get("/hello")).andExpect(status().is3xxRedirection()).andExpect(redirectedUrl("/login"));
5050
}
5151

5252
@Test
5353
@WithMockUser
5454
void accessSecuredResourceAuthenticatedThenOk() throws Exception {
55-
MvcResult mvcResult = mockMvc.perform(get("/hello")).andExpect(status().isOk()).andReturn();
55+
MvcResult mvcResult = this.mockMvc.perform(get("/hello")).andExpect(status().isOk()).andReturn();
5656

5757
assertThat(mvcResult.getResponse().getContentAsString()).contains("Hello user!");
5858
}

0 commit comments

Comments
 (0)