Assert.assertThat(book.getSell(), is(true));
}
@Test
public void testResponseOutput() {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setRequestURI("/firefly/app/hello/text");
request.setServletPath("/app");
request.setContextPath("/firefly");
request.setMethod("GET");
MockHttpServletResponse response = new MockHttpServletResponse();
dispatcherController.dispatch(request, response);
Assert.assertThat(response.getAsString(), is("文本输出"));
request = new MockHttpServletRequest();
request.setRequestURI("/firefly/app/hello/text-xo/333-444");
request.setServletPath("/app");
request.setContextPath("/firefly");
request.setMethod("GET");
response = new MockHttpServletResponse();
dispatcherController.dispatch(request, response);
Assert.assertThat(response.getAsString(), is("text-xo-333-444"));
request = new MockHttpServletRequest();
request.setRequestURI("/firefly/app/hello55555/");
request.setServletPath("/app");
request.setContextPath("/firefly");
request.setMethod("GET");
response = new MockHttpServletResponse();
dispatcherController.dispatch(request, response);
Assert.assertThat(response.getAsString(), is("text-55555"));
}