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

@@ -24,8 +24,7 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.R
@SpringBootApplication
@EnableResourceServer
public class SampleSecureOAuth2ResourceApplication
extends ResourceServerConfigurerAdapter {
public class SampleSecureOAuth2ResourceApplication extends ResourceServerConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {

View File

@@ -56,29 +56,26 @@ public class SampleSecureOAuth2ResourceApplicationTests {
@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 homePageAvailable() throws Exception {
this.mvc.perform(get("/").accept(MediaTypes.HAL_JSON)).andExpect(status().isOk())
.andDo(print());
this.mvc.perform(get("/").accept(MediaTypes.HAL_JSON)).andExpect(status().isOk()).andDo(print());
}
@Test
public void flightsSecuredByDefault() throws Exception {
this.mvc.perform(get("/flights").accept(MediaTypes.HAL_JSON))
.andExpect(status().isUnauthorized()).andDo(print());
this.mvc.perform(get("/flights/1").accept(MediaTypes.HAL_JSON))
.andExpect(status().isUnauthorized()).andDo(print());
this.mvc.perform(get("/flights").accept(MediaTypes.HAL_JSON)).andExpect(status().isUnauthorized())
.andDo(print());
this.mvc.perform(get("/flights/1").accept(MediaTypes.HAL_JSON)).andExpect(status().isUnauthorized())
.andDo(print());
}
@Test
public void profileAvailable() throws Exception {
this.mvc.perform(get("/profile").accept(MediaTypes.HAL_JSON))
.andExpect(status().isOk()).andDo(print());
this.mvc.perform(get("/profile").accept(MediaTypes.HAL_JSON)).andExpect(status().isOk()).andDo(print());
}
}