Search in sources :

Example 1 with RawResponse

use of com.ecwid.consul.transport.RawResponse in project cloudbreak by hortonworks.

the class ConsulHostServiceTypeCheckerTaskTest method checkStatusForOneNodeResponse.

@Test
@SuppressWarnings("unchecked")
public void checkStatusForOneNodeResponse() {
    ConsulRawClient raw1 = mock(ConsulRawClient.class);
    RawResponse rawResponse = new RawResponse(200, null, SERVICE_RESPONSE, null, null, null);
    ConsulClient client1 = new ConsulClient(raw1);
    when(raw1.makeGetRequest(SERVICE_ENDPOINT + AMBARI_SERVICE, null, QueryParams.DEFAULT)).thenReturn(rawResponse);
    boolean result = task.checkStatus(new ConsulContext(stack, client1, Collections.singletonList(AMBARI_SERVICE)));
    assertTrue(result);
}
Also used : ConsulClient(com.ecwid.consul.v1.ConsulClient) ConsulRawClient(com.ecwid.consul.v1.ConsulRawClient) RawResponse(com.ecwid.consul.transport.RawResponse) Test(org.junit.Test)

Aggregations

RawResponse (com.ecwid.consul.transport.RawResponse)1 ConsulClient (com.ecwid.consul.v1.ConsulClient)1 ConsulRawClient (com.ecwid.consul.v1.ConsulRawClient)1 Test (org.junit.Test)1