use of io.leopard.web.view.OnlyJsonView in project leopard by tanhaichao.
the class OnlyJsonViewTest method getData.
@Test
public void getData() {
OnlyJsonView onlyJsonView = new OnlyJsonView("message");
Assert.assertEquals("message", onlyJsonView.getData());
}
use of io.leopard.web.view.OnlyJsonView in project leopard by tanhaichao.
the class OnlyJsonViewTest method getBody.
@Test
public void getBody() {
HttpServletRequest request = new MockHttpServletRequest();
HttpServletResponse response = new MockHttpServletResponse();
OnlyJsonView onlyJsonView = new OnlyJsonView("message");
Assert.assertEquals("\"message\"", onlyJsonView.getBody(request, response));
}
use of io.leopard.web.view.OnlyJsonView in project leopard by tanhaichao.
the class OnlyJsonViewTest method getContentType.
// @Test
// public void getJson() {
// OnlyJsonView onlyJsonView = new OnlyJsonView("message");
// Assert.assertEquals("\"message\"", onlyJsonView.getJson());
// }
@Test
public void getContentType() {
OnlyJsonView onlyJsonView = new OnlyJsonView("message");
Assert.assertEquals("text/plain; charset=UTF-8", onlyJsonView.getContentType());
}
Aggregations