@Test
public void testAddShellStepToEmrCluster() throws Exception
{

    // Create an add step request.
    EmrShellStepAddRequest emrShellStepAddRequest =
        new EmrShellStepAddRequest(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, EMR_STEP_NAME, EMR_STEP_SCRIPT_LOCATION,
            Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE), CONTINUE_ON_ERROR, EMR_CLUSTER_ID, AWS_ACCOUNT_ID);
    // Create an add step response.
    EmrShellStep emrShellStep =
        new EmrShellStep(EMR_STEP_ID, NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, EMR_STEP_NAME, EMR_STEP_SCRIPT_LOCATION,
            Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE), CONTINUE_ON_ERROR, EMR_CLUSTER_ID);
    // Mock the external calls.
    when(emrService.addStepToCluster(emrShellStepAddRequest)).thenReturn(emrShellStep);
    // Call the method under test.
    EmrShellStep result = emrRestController.addShellStepToEmrCluster(emrShellStepAddRequest);
    // Verify the external calls.
    verify(emrService).addStepToCluster(emrShellStepAddRequest);
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(emrShellStep, result);
}