Search in sources :

Example 1 with TextView

use of io.leopard.web.view.TextView in project leopard by tanhaichao.

the class TextViewTest method getMessage.

@Test
public void getMessage() {
    TextView textView = new TextView("message");
    Assert.assertEquals("message", textView.getMessage());
}
Also used : TextView(io.leopard.web.view.TextView) Test(org.junit.Test)

Example 2 with TextView

use of io.leopard.web.view.TextView in project leopard by tanhaichao.

the class TextViewTest method getBody.

@Test
public void getBody() {
    HttpServletRequest request = new MockHttpServletRequest();
    HttpServletResponse response = new MockHttpServletResponse();
    TextView textView = new TextView("message");
    Assert.assertEquals("message", textView.getBody(request, response));
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) HttpServletResponse(javax.servlet.http.HttpServletResponse) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) TextView(io.leopard.web.view.TextView) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) Test(org.junit.Test)

Example 3 with TextView

use of io.leopard.web.view.TextView in project leopard by tanhaichao.

the class TextViewTest method getContentType.

@Test
public void getContentType() {
    TextView textView = new TextView("message");
    Assert.assertEquals("text/plain; charset=UTF-8", textView.getContentType());
}
Also used : TextView(io.leopard.web.view.TextView) Test(org.junit.Test)

Aggregations

TextView (io.leopard.web.view.TextView)3 Test (org.junit.Test)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)1 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)1