Search in sources :

Example 6 with WsAgentHealthStateDto

use of org.eclipse.che.api.workspace.shared.dto.WsAgentHealthStateDto in project che by eclipse.

the class WsAgentHealthCheckerTest method returnResultWithUnavailableStateIfDoNotGetResponseFromWsAgent.

@Test
public void returnResultWithUnavailableStateIfDoNotGetResponseFromWsAgent() throws Exception {
    doThrow(IOException.class).when(httpJsonRequest).request();
    final WsAgentHealthStateDto result = checker.check(devMachine);
    verify(httpJsonRequest).request();
    assertEquals(SERVICE_UNAVAILABLE.getStatusCode(), result.getCode());
}
Also used : WsAgentHealthStateDto(org.eclipse.che.api.workspace.shared.dto.WsAgentHealthStateDto) Test(org.testng.annotations.Test)

Example 7 with WsAgentHealthStateDto

use of org.eclipse.che.api.workspace.shared.dto.WsAgentHealthStateDto in project che by eclipse.

the class WsAgentHealthCheckerTest method pingRequestToWsAgentShouldBeSent.

@Test
public void pingRequestToWsAgentShouldBeSent() throws Exception {
    final WsAgentHealthStateDto result = checker.check(devMachine);
    verify(httpJsonRequest).request();
    assertEquals(200, result.getCode());
}
Also used : WsAgentHealthStateDto(org.eclipse.che.api.workspace.shared.dto.WsAgentHealthStateDto) Test(org.testng.annotations.Test)

Aggregations

WsAgentHealthStateDto (org.eclipse.che.api.workspace.shared.dto.WsAgentHealthStateDto)7 Test (org.testng.annotations.Test)5 MachineImpl (org.eclipse.che.api.machine.server.model.impl.MachineImpl)2 WorkspaceImpl (org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl)2 Response (com.jayway.restassured.response.Response)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 IOException (java.io.IOException)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 ApiException (org.eclipse.che.api.core.ApiException)1 Server (org.eclipse.che.api.core.model.machine.Server)1 HttpJsonRequest (org.eclipse.che.api.core.rest.HttpJsonRequest)1 HttpJsonResponse (org.eclipse.che.api.core.rest.HttpJsonResponse)1 ExtendedMachineImpl (org.eclipse.che.api.workspace.server.model.impl.ExtendedMachineImpl)1 WorkspaceRuntimeImpl (org.eclipse.che.api.workspace.server.model.impl.WorkspaceRuntimeImpl)1