use of org.finra.herd.model.api.xml.EmrClusterDefinitionInformation in project herd by FINRAOS.
the class EmrClusterDefinitionServiceTest method testGetEmrClusterDefinitionUpperCaseParameters.
@Test
public void testGetEmrClusterDefinitionUpperCaseParameters() throws Exception {
// Create and persist the namespace entity with a lowercase name.
NamespaceEntity namespaceEntity = namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE.toLowerCase());
// Create and persist the EMR cluster definition entity with a lowercase name.
EmrClusterDefinitionEntity emrClusterDefinitionEntity = emrClusterDefinitionDaoTestHelper.createEmrClusterDefinitionEntity(namespaceEntity, EMR_CLUSTER_DEFINITION_NAME.toLowerCase(), getTestEmrClusterDefinitionConfigurationXml(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH));
// Get an EMR cluster definition by passing the EMR cluster definition name key parameters in upper case.
EmrClusterDefinitionInformation resultEmrClusterDefinition = emrClusterDefinitionService.getEmrClusterDefinition(new EmrClusterDefinitionKey(NAMESPACE.toUpperCase(), EMR_CLUSTER_DEFINITION_NAME.toUpperCase()));
// Validate the returned object.
validateEmrClusterDefinition(emrClusterDefinitionEntity.getId(), NAMESPACE.toLowerCase(), EMR_CLUSTER_DEFINITION_NAME.toLowerCase(), getTestEmrClusterDefinitionConfiguration(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH), resultEmrClusterDefinition);
}
use of org.finra.herd.model.api.xml.EmrClusterDefinitionInformation in project herd by FINRAOS.
the class EmrClusterDefinitionServiceTest method testCreateEmrClusterDefinition.
@Test
public void testCreateEmrClusterDefinition() throws Exception {
// Create and persist the namespace entity.
namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
// Create an EMR cluster definition create request.
EmrClusterDefinitionCreateRequest request = createEmrClusterDefinitionCreateRequest(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, getTestEmrClusterDefinitionConfiguration(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH));
// Create an EMR cluster definition.
EmrClusterDefinitionInformation resultEmrClusterDefinition = emrClusterDefinitionService.createEmrClusterDefinition(request);
// Validate the returned object.
validateEmrClusterDefinition(null, NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, getTestEmrClusterDefinitionConfiguration(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH), resultEmrClusterDefinition);
}
use of org.finra.herd.model.api.xml.EmrClusterDefinitionInformation in project herd by FINRAOS.
the class EmrClusterDefinitionServiceTest method testCreateEmrClusterDefinitionUpperCaseParameters.
@Test
public void testCreateEmrClusterDefinitionUpperCaseParameters() throws Exception {
// Create and persist the namespace entity with a lowercase name.
namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE.toLowerCase());
// Create an EMR cluster definition create request by passing the EMR cluster definition name key parameters in upper case.
EmrClusterDefinitionCreateRequest request = createEmrClusterDefinitionCreateRequest(NAMESPACE.toUpperCase(), EMR_CLUSTER_DEFINITION_NAME.toUpperCase(), getTestEmrClusterDefinitionConfiguration(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH));
// Create an EMR cluster definition.
EmrClusterDefinitionInformation resultEmrClusterDefinition = emrClusterDefinitionService.createEmrClusterDefinition(request);
// Validate the returned object.
validateEmrClusterDefinition(null, NAMESPACE.toLowerCase(), EMR_CLUSTER_DEFINITION_NAME.toUpperCase(), getTestEmrClusterDefinitionConfiguration(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH), resultEmrClusterDefinition);
}
use of org.finra.herd.model.api.xml.EmrClusterDefinitionInformation in project herd by FINRAOS.
the class EmrClusterDefinitionRestControllerTest method testUpdateEmrClusterDefinition.
@Test
public void testUpdateEmrClusterDefinition() throws Exception {
// Create an EMR cluster definition key.
EmrClusterDefinitionKey emrClusterDefinitionKey = new EmrClusterDefinitionKey(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME);
// Create an EMR cluster definition.
EmrClusterDefinition emrClusterDefinition = new EmrClusterDefinition();
// Create an EMR cluster definition update request.
EmrClusterDefinitionUpdateRequest emrClusterDefinitionUpdateRequest = new EmrClusterDefinitionUpdateRequest(emrClusterDefinition);
// Create an object that holds EMR cluster definition information.
EmrClusterDefinitionInformation emrClusterDefinitionInformation = new EmrClusterDefinitionInformation(ID, emrClusterDefinitionKey, emrClusterDefinition);
// Mock the external calls.
when(emrClusterDefinitionService.updateEmrClusterDefinition(emrClusterDefinitionKey, emrClusterDefinitionUpdateRequest)).thenReturn(emrClusterDefinitionInformation);
// Call the method under test.
EmrClusterDefinitionInformation result = emrClusterDefinitionRestController.updateEmrClusterDefinition(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, emrClusterDefinitionUpdateRequest);
// Verify the external calls.
verify(emrClusterDefinitionService).updateEmrClusterDefinition(emrClusterDefinitionKey, emrClusterDefinitionUpdateRequest);
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(emrClusterDefinitionInformation, result);
}
use of org.finra.herd.model.api.xml.EmrClusterDefinitionInformation in project herd by FINRAOS.
the class EmrClusterDefinitionRestControllerTest method testGetEmrClusterDefinition.
@Test
public void testGetEmrClusterDefinition() throws Exception {
// Create an EMR cluster definition key.
EmrClusterDefinitionKey emrClusterDefinitionKey = new EmrClusterDefinitionKey(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME);
// Create an EMR cluster definition.
EmrClusterDefinition emrClusterDefinition = new EmrClusterDefinition();
// Create an object that holds EMR cluster definition information.
EmrClusterDefinitionInformation emrClusterDefinitionInformation = new EmrClusterDefinitionInformation(ID, emrClusterDefinitionKey, emrClusterDefinition);
// Mock the external calls.
when(emrClusterDefinitionService.getEmrClusterDefinition(emrClusterDefinitionKey)).thenReturn(emrClusterDefinitionInformation);
// Call the method under test.
EmrClusterDefinitionInformation result = emrClusterDefinitionRestController.getEmrClusterDefinition(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME);
// Verify the external calls.
verify(emrClusterDefinitionService).getEmrClusterDefinition(emrClusterDefinitionKey);
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(emrClusterDefinitionInformation, result);
}
Aggregations