use of com.amazonaws.services.elasticmapreduce.model.InstanceGroupConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetInstanceGroupConfigWhenBidPriceIsNull.
@Test
public void testGetInstanceGroupConfigWhenBidPriceIsNull() {
// Call the method under test.
InstanceGroupConfig result = emrDaoImpl.getInstanceGroupConfig(InstanceRoleType.MASTER, EC2_INSTANCE_TYPE, INSTANCE_COUNT, NO_BID_PRICE, NO_EMR_CLUSTER_DEFINITION_EBS_CONFIGURATION);
// Verify the external calls.
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(new InstanceGroupConfig(InstanceRoleType.MASTER, EC2_INSTANCE_TYPE, INSTANCE_COUNT), result);
}
use of com.amazonaws.services.elasticmapreduce.model.InstanceGroupConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetInstanceGroupConfigsMissingOptionalInstanceDefinitions.
@Test
public void testGetInstanceGroupConfigsMissingOptionalInstanceDefinitions() {
// Create objects required for testing.
final Integer instanceCount = 0;
final InstanceDefinitions instanceDefinitions = new InstanceDefinitions(new MasterInstanceDefinition(), null, null);
// Mock the external calls.
when(emrHelper.isInstanceDefinitionsEmpty(instanceDefinitions)).thenReturn(false);
// Call the method under test.
List<InstanceGroupConfig> result = emrDaoImpl.getInstanceGroupConfigs(instanceDefinitions);
// Verify the external calls.
verify(emrHelper).isInstanceDefinitionsEmpty(instanceDefinitions);
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(Arrays.asList(new InstanceGroupConfig(InstanceRoleType.MASTER, null, instanceCount)), result);
}
use of com.amazonaws.services.elasticmapreduce.model.InstanceGroupConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetInstanceGroupConfigsWhenInstanceDefinitionsObjectIsEmpty.
@Test
public void testGetInstanceGroupConfigsWhenInstanceDefinitionsObjectIsEmpty() {
// Create objects required for testing.
final InstanceDefinitions instanceDefinitions = new InstanceDefinitions();
// Mock the external calls.
when(emrHelper.isInstanceDefinitionsEmpty(instanceDefinitions)).thenReturn(true);
// Call the method under test.
List<InstanceGroupConfig> result = emrDaoImpl.getInstanceGroupConfigs(instanceDefinitions);
// Verify the external calls.
verify(emrHelper).isInstanceDefinitionsEmpty(instanceDefinitions);
verifyNoMoreInteractionsHelper();
// Validate the results.
assertNull(result);
}
use of com.amazonaws.services.elasticmapreduce.model.InstanceGroupConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetInstanceGroupConfigs.
@Test
public void testGetInstanceGroupConfigs() {
// Create objects required for testing.
final Integer instanceCount = 0;
final InstanceDefinitions instanceDefinitions = new InstanceDefinitions(new MasterInstanceDefinition(), new InstanceDefinition(), new InstanceDefinition());
// Mock the external calls.
when(emrHelper.isInstanceDefinitionsEmpty(instanceDefinitions)).thenReturn(false);
// Call the method under test.
List<InstanceGroupConfig> result = emrDaoImpl.getInstanceGroupConfigs(instanceDefinitions);
// Verify the external calls.
verify(emrHelper).isInstanceDefinitionsEmpty(instanceDefinitions);
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(3, CollectionUtils.size(result));
assertTrue(result.contains(new InstanceGroupConfig(InstanceRoleType.MASTER, null, instanceCount)));
assertTrue(result.contains(new InstanceGroupConfig(InstanceRoleType.CORE, null, instanceCount)));
assertTrue(result.contains(new InstanceGroupConfig(InstanceRoleType.TASK, null, instanceCount)));
}
use of com.amazonaws.services.elasticmapreduce.model.InstanceGroupConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetInstanceGroupConfig.
@Test
public void testGetInstanceGroupConfig() throws Exception {
// Call the method under test.
InstanceGroupConfig result = emrDaoImpl.getInstanceGroupConfig(InstanceRoleType.MASTER, EC2_INSTANCE_TYPE, INSTANCE_COUNT, BID_PRICE, new EmrClusterDefinitionEbsConfiguration(Collections.singletonList(new EmrClusterDefinitionEbsBlockDeviceConfig(new EmrClusterDefinitionVolumeSpecification(VOLUME_TYPE, IOPS, SIZE_IN_GB), VOLUMES_PER_INSTANCE)), EBS_OPTIMIZED));
// Verify the external calls.
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(new InstanceGroupConfig(InstanceRoleType.MASTER, EC2_INSTANCE_TYPE, INSTANCE_COUNT).withMarket(MarketType.SPOT).withBidPrice(BID_PRICE.toPlainString()).withEbsConfiguration(new EbsConfiguration().withEbsBlockDeviceConfigs(new EbsBlockDeviceConfig().withVolumeSpecification(new VolumeSpecification().withVolumeType(VOLUME_TYPE).withIops(IOPS).withSizeInGB(SIZE_IN_GB)).withVolumesPerInstance(VOLUMES_PER_INSTANCE)).withEbsOptimized(EBS_OPTIMIZED)), result);
}
Aggregations