Upgrade to spring-javaformat 0.0.11
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user