Upgrade to spring-javaformat 0.0.11

This commit is contained in:
Andy Wilkinson
2019-06-07 09:44:58 +01:00
parent d548c5ed31
commit 8f1be4cded
1940 changed files with 16814 additions and 28498 deletions

View File

@@ -57,16 +57,14 @@ public class SampleSecureOAuth2ActuatorApplicationTests {
@Before
public void setUp() {
this.mvc = MockMvcBuilders.webAppContextSetup(this.context)
.addFilters(this.filterChain).build();
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).addFilters(this.filterChain).build();
SecurityContextHolder.clearContext();
}
@Test
public void homePageSecuredByDefault() throws Exception {
this.mvc.perform(get("/")).andExpect(status().isUnauthorized())
.andExpect(header().string("WWW-Authenticate", containsString("Bearer")))
.andDo(print());
.andExpect(header().string("WWW-Authenticate", containsString("Bearer"))).andDo(print());
}
@Test
@@ -77,14 +75,13 @@ public class SampleSecureOAuth2ActuatorApplicationTests {
@Test
public void envSecuredWithBasic() throws Exception {
this.mvc.perform(get("/env")).andExpect(status().isUnauthorized())
.andExpect(header().string("WWW-Authenticate", containsString("Basic")))
.andDo(print());
.andExpect(header().string("WWW-Authenticate", containsString("Basic"))).andDo(print());
}
@Test
public void envWithPassword() throws Exception {
this.mvc.perform(get("/env").header("Authorization",
"Basic " + Base64Utils.encodeToString("user:password".getBytes())))
this.mvc.perform(
get("/env").header("Authorization", "Basic " + Base64Utils.encodeToString("user:password".getBytes())))
.andExpect(status().isOk()).andDo(print());
}