@Test
public void testCreateEmrCluster() throws Exception
{

    // Create an EMR cluster definition override.
    EmrClusterDefinition emrClusterDefinitionOverride = new EmrClusterDefinition();
    // Create an EMR cluster create request.
    EmrClusterCreateRequest emrClusterCreateRequest =
        new EmrClusterCreateRequest(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, DRY_RUN, emrClusterDefinitionOverride);
    // Create an EMR cluster.
    EmrCluster emrCluster = new EmrCluster();
    emrCluster.setId(EMR_CLUSTER_ID);
    // Mock the external calls.
    when(emrService.createCluster(emrClusterCreateRequest)).thenReturn(emrCluster);
    // Call the method under test.
    EmrCluster result = emrRestController.createEmrCluster(emrClusterCreateRequest);
    // Verify the external calls.
    verify(emrService).createCluster(emrClusterCreateRequest);
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(emrCluster, result);
}