@Test
public void crud() throws Exception {
initServletWithControllers(CrudController.class);
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/hotels");
MockHttpServletResponse response = new MockHttpServletResponse();
getServlet().service(request, response);
assertEquals("list", response.getContentAsString());
request = new MockHttpServletRequest("GET", "/hotels/");
response = new MockHttpServletResponse();
getServlet().service(request, response);
assertEquals("list", response.getContentAsString());
request = new MockHttpServletRequest("POST", "/hotels");
response = new MockHttpServletResponse();
getServlet().service(request, response);
assertEquals("create", response.getContentAsString());
request = new MockHttpServletRequest("GET", "/hotels/42");
response = new MockHttpServletResponse();
getServlet().service(request, response);
assertEquals("show-42", response.getContentAsString());
request = new MockHttpServletRequest("GET", "/hotels/42/");
response = new MockHttpServletResponse();
getServlet().service(request, response);
assertEquals("show-42", response.getContentAsString());
request = new MockHttpServletRequest("PUT", "/hotels/42");
response = new MockHttpServletResponse();
getServlet().service(request, response);
assertEquals("createOrUpdate-42", response.getContentAsString());
request = new MockHttpServletRequest("DELETE", "/hotels/42");
response = new MockHttpServletResponse();
getServlet().service(request, response);
assertEquals("remove-42", response.getContentAsString());
}