use of org.finra.herd.model.api.xml.EmrMasterSecurityGroupAddRequest in project herd by FINRAOS.
the class EmrServiceTest method testAddSecurityGroupEC2InstanceNotProvisioned.
/**
* This method tests the scenario where EC2 instances have not been provisioned yet
*/
@Test(expected = IllegalArgumentException.class)
public void testAddSecurityGroupEC2InstanceNotProvisioned() throws Exception {
// Create the namespace entity.
NamespaceEntity namespaceEntity = namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
emrClusterDefinitionDaoTestHelper.createEmrClusterDefinitionEntity(namespaceEntity, EMR_CLUSTER_DEFINITION_NAME, IOUtils.toString(resourceLoader.getResource(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH).getInputStream()));
EmrClusterCreateRequest request = getNewEmrClusterCreateRequest();
request.setEmrClusterName(MockEmrOperationsImpl.MOCK_CLUSTER_NOT_PROVISIONED_NAME);
emrService.createCluster(request);
// Create the Add security group.
EmrMasterSecurityGroupAddRequest emrMasterSecurityGroupAddRequest = getNewEmrAddSecurityGroupMasterRequest(request.getEmrClusterName());
emrService.addSecurityGroupsToClusterMaster(emrMasterSecurityGroupAddRequest);
}
Aggregations