use of com.sequenceiq.cloudbreak.cloud.model.AvailabilityZone in project cloudbreak by hortonworks.
the class MockPlatformResources method readVmTypes.
private Map<String, Set<VmType>> readVmTypes() {
Map<String, Set<VmType>> availabilityZoneHashMap = new HashMap<>();
Set<VmType> vmTypeList = new HashSet<>();
for (MockedVmTypes vmType : MockedVmTypes.values()) {
vmTypeList.add(VmType.vmTypeWithMeta(vmType.value, vmType.getVmTypeMeta(), true));
}
for (Entry<Region, List<AvailabilityZone>> regionListEntry : regions.entrySet()) {
for (AvailabilityZone availabilityZone : regionListEntry.getValue()) {
availabilityZoneHashMap.put(availabilityZone.value(), vmTypeList);
}
}
return availabilityZoneHashMap;
}
use of com.sequenceiq.cloudbreak.cloud.model.AvailabilityZone in project cloudbreak by hortonworks.
the class OpenStackClientTest method testGetZonesWhenAvailabiltyZonesEmpt.
@Test
public void testGetZonesWhenAvailabiltyZonesEmpt() {
OSClient<?> osClient = mock(OSClient.class);
ComputeService computeService = mock(ComputeService.class);
ZoneService zoneService = mock(ZoneService.class);
when(osClient.compute()).thenReturn(computeService);
when(computeService.zones()).thenReturn(zoneService);
when(zoneService.list()).thenReturn(Collections.emptyList());
List<AvailabilityZone> actual = underTest.getZones(osClient, "region");
Assert.assertEquals(0, actual.size());
}
Aggregations