Update formatting of spring-boot-samples

This commit is contained in:
Andy Wilkinson
2019-06-08 08:16:27 +01:00
parent da1d4b8c3b
commit 9d28238598
167 changed files with 745 additions and 1172 deletions

View File

@@ -41,8 +41,7 @@ public class MyController {
sessionVar = new Date();
session.setAttribute("var", sessionVar);
}
ModelMap model = new ModelMap("message", Message.MESSAGE)
.addAttribute("sessionVar", sessionVar);
ModelMap model = new ModelMap("message", Message.MESSAGE).addAttribute("sessionVar", sessionVar);
return new ModelAndView("hello", model);
}

View File

@@ -44,24 +44,21 @@ public class SampleDevToolsApplicationIntegrationTests {
@Test
public void testStaticResource() {
ResponseEntity<String> entity = this.restTemplate
.getForEntity("/css/application.css", String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/css/application.css", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).contains("color: green;");
}
@Test
public void testPublicResource() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/public.txt",
String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/public.txt", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).contains("public file");
}
@Test
public void testClassResource() {
ResponseEntity<String> entity = this.restTemplate
.getForEntity("/application.properties", String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/application.properties", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}