Search in sources :

Example 11 with EmrMasterSecurityGroupAddRequest

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);
}
Also used : NamespaceEntity(org.finra.herd.model.jpa.NamespaceEntity) EmrMasterSecurityGroupAddRequest(org.finra.herd.model.api.xml.EmrMasterSecurityGroupAddRequest) EmrClusterCreateRequest(org.finra.herd.model.api.xml.EmrClusterCreateRequest) Test(org.junit.Test)

Aggregations

EmrMasterSecurityGroupAddRequest (org.finra.herd.model.api.xml.EmrMasterSecurityGroupAddRequest)11 Test (org.junit.Test)8 EmrClusterCreateRequest (org.finra.herd.model.api.xml.EmrClusterCreateRequest)6 NamespaceEntity (org.finra.herd.model.jpa.NamespaceEntity)6 EmrMasterSecurityGroup (org.finra.herd.model.api.xml.EmrMasterSecurityGroup)4 ArrayList (java.util.ArrayList)2 ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)1 EmrShellStepAddRequest (org.finra.herd.model.api.xml.EmrShellStepAddRequest)1 EmrClusterAlternateKeyDto (org.finra.herd.model.dto.EmrClusterAlternateKeyDto)1