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

@@ -58,8 +58,7 @@ public class MessageController {
}
@PostMapping
public ModelAndView create(@Valid Message message, BindingResult result,
RedirectAttributes redirect) {
public ModelAndView create(@Valid Message message, BindingResult result, RedirectAttributes redirect) {
if (result.hasErrors()) {
return new ModelAndView("messages/form", "formErrors", result.getAllErrors());
}

View File

@@ -68,15 +68,13 @@ public class MessageControllerWebTests {
@Test
public void testCreate() throws Exception {
this.mockMvc.perform(post("/").param("text", "FOO text").param("summary", "FOO"))
.andExpect(status().isFound())
this.mockMvc.perform(post("/").param("text", "FOO text").param("summary", "FOO")).andExpect(status().isFound())
.andExpect(header().string("location", RegexMatcher.matches("/[0-9]+")));
}
@Test
public void testCreateValidation() throws Exception {
this.mockMvc.perform(post("/").param("text", "").param("summary", ""))
.andExpect(status().isOk())
this.mockMvc.perform(post("/").param("text", "").param("summary", "")).andExpect(status().isOk())
.andExpect(content().string(containsString("is required")));
}
@@ -100,8 +98,7 @@ public class MessageControllerWebTests {
@Override
public void describeTo(Description description) {
description.appendText("a string that matches regex: ")
.appendText(this.regex);
description.appendText("a string that matches regex: ").appendText(this.regex);
}
public static org.hamcrest.Matcher<java.lang.String> matches(String regex) {

View File

@@ -70,8 +70,8 @@ public class SampleWebUiApplicationTests {
@Test
public void testCss() throws Exception {
ResponseEntity<String> entity = this.restTemplate.getForEntity(
"http://localhost:" + this.port + "/css/bootstrap.min.css", String.class);
ResponseEntity<String> entity = this.restTemplate
.getForEntity("http://localhost:" + this.port + "/css/bootstrap.min.css", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).contains("body");
}