Polish
This commit is contained in:
@@ -32,14 +32,14 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
public class SampleServletApplication {
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Bean
|
||||
public Servlet dispatcherServlet() {
|
||||
return new GenericServlet() {
|
||||
@Override
|
||||
public void service(ServletRequest req, ServletResponse res) throws ServletException,
|
||||
IOException {
|
||||
public void service(ServletRequest req, ServletResponse res)
|
||||
throws ServletException, IOException {
|
||||
res.setContentType("text/plain");
|
||||
res.getWriter().append("Hello World");
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ public class SampleServletApplicationTests {
|
||||
|
||||
@Test
|
||||
public void testHome() throws Exception {
|
||||
ResponseEntity<String> entity = getRestTemplate("user", getPassword()).getForEntity(
|
||||
"http://localhost:8080", String.class);
|
||||
ResponseEntity<String> entity = getRestTemplate("user", getPassword())
|
||||
.getForEntity("http://localhost:8080", String.class);
|
||||
assertEquals(HttpStatus.OK, entity.getStatusCode());
|
||||
assertEquals("Hello World", entity.getBody());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user