use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.
the class ClouderaManagerHostStatusCheckerTest method shouldBeTrueWhenOneInstanceIsOrchestrationFailed.
@Test
public void shouldBeTrueWhenOneInstanceIsOrchestrationFailed() throws ApiException {
InstanceMetaData instanceMetaData = validInstanceMetadata();
InstanceMetaData instanceMetaData2 = validInstanceMetadata();
instanceMetaData2.setPrivateIp("2.2.2.2");
instanceMetaData2.setInstanceStatus(InstanceStatus.ORCHESTRATION_FAILED);
ApiHost apiHost = getValidApiHost(instanceMetaData);
when(hostsResourceApi.readHosts(null, null, VIEWTYPE)).thenReturn(new ApiHostList().items(List.of(apiHost)));
boolean result = underTest.doStatusCheck(getPollerObject(instanceMetaData, instanceMetaData2));
assertTrue(result);
}
use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.
the class ClouderaManagerHostStatusCheckerTest method shouldBeTrueWhenOneInstanceIsTerminated.
@Test
public void shouldBeTrueWhenOneInstanceIsTerminated() throws ApiException {
InstanceMetaData instanceMetaData = validInstanceMetadata();
InstanceMetaData instanceMetaData2 = validInstanceMetadata();
instanceMetaData2.setPrivateIp("2.2.2.2");
instanceMetaData2.setInstanceStatus(InstanceStatus.TERMINATED);
ApiHost apiHost = getValidApiHost(instanceMetaData);
when(hostsResourceApi.readHosts(null, null, VIEWTYPE)).thenReturn(new ApiHostList().items(List.of(apiHost)));
boolean result = underTest.doStatusCheck(getPollerObject(instanceMetaData, instanceMetaData2));
assertTrue(result);
}
use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.
the class ClouderaManagerHostStatusCheckerTest method shouldBeFalseWhenHostsHasMissingHost.
@Test
public void shouldBeFalseWhenHostsHasMissingHost() throws ApiException {
InstanceMetaData instanceMetaData = validInstanceMetadata();
InstanceMetaData instanceMetaData2 = validInstanceMetadata();
instanceMetaData2.setPrivateIp("2.2.2.2");
ApiHost apiHost = getValidApiHost(instanceMetaData);
when(hostsResourceApi.readHosts(null, null, VIEWTYPE)).thenReturn(new ApiHostList().items(List.of(apiHost)));
boolean result = underTest.doStatusCheck(getPollerObject(instanceMetaData, instanceMetaData2));
assertFalse(result);
}
use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.
the class ClouderaManagerHostStatusCheckerTest method shouldBeTrueWhenHostsReturnedHasRecentHeartbeat.
@Test
public void shouldBeTrueWhenHostsReturnedHasRecentHeartbeat() throws ApiException {
InstanceMetaData instanceMetaData = validInstanceMetadata();
ApiHost apiHost = getValidApiHost(instanceMetaData);
when(hostsResourceApi.readHosts(null, null, VIEWTYPE)).thenReturn(new ApiHostList().items(List.of(apiHost)));
boolean result = underTest.doStatusCheck(getPollerObject(instanceMetaData));
assertTrue(result);
}
use of com.cloudera.api.swagger.model.ApiHost in project cloudbreak by hortonworks.
the class ClouderaManagerHostStatusCheckerTest method shouldBeTrueWhenOneInstanceHasNoDiscoveryFqdn.
@Test
public void shouldBeTrueWhenOneInstanceHasNoDiscoveryFqdn() throws ApiException {
InstanceMetaData instanceMetaData = validInstanceMetadata();
InstanceMetaData instanceMetaData2 = validInstanceMetadata();
instanceMetaData2.setPrivateIp("2.2.2.2");
instanceMetaData2.setDiscoveryFQDN(null);
ApiHost apiHost = getValidApiHost(instanceMetaData);
when(hostsResourceApi.readHosts(null, null, VIEWTYPE)).thenReturn(new ApiHostList().items(List.of(apiHost)));
boolean result = underTest.doStatusCheck(getPollerObject(instanceMetaData, instanceMetaData2));
assertTrue(result);
}
Aggregations