Search in sources :

Example 1 with HealthCheckServlet

use of com.tvd12.ezyfoxserver.nio.builder.impl.EzyWebSocketServerCreator.HealthCheckServlet in project ezyfox-server by youngmonkeys.

the class EzyWebSocketServerCreatorTest method healthCheckServletTest.

@Test
public void healthCheckServletTest() {
    // given
    HealthCheckServlet sut = new HealthCheckServlet();
    HttpServletRequest request = mock(HttpServletRequest.class);
    HttpServletResponse response = mock(HttpServletResponse.class);
    // when
    MethodInvoker.create().object(sut).method("doGet").param(HttpServletRequest.class, request).param(HttpServletResponse.class, response).call();
    // then
    verify(response, times(1)).setStatus(200);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) HealthCheckServlet(com.tvd12.ezyfoxserver.nio.builder.impl.EzyWebSocketServerCreator.HealthCheckServlet) HttpServletResponse(javax.servlet.http.HttpServletResponse) Test(org.testng.annotations.Test)

Aggregations

HealthCheckServlet (com.tvd12.ezyfoxserver.nio.builder.impl.EzyWebSocketServerCreator.HealthCheckServlet)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 Test (org.testng.annotations.Test)1