@Test
public void testAddHiveStepToEmrCluster() throws Exception
{

    // Create an add step request.
    EmrHiveStepAddRequest emrHiveStepAddRequest =
        new EmrHiveStepAddRequest(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.
    EmrHiveStep emrHiveStep =
        new EmrHiveStep(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(emrHiveStepAddRequest)).thenReturn(emrHiveStep);
    // Call the method under test.
    EmrHiveStep result = emrRestController.addHiveStepToEmrCluster(emrHiveStepAddRequest);
    // Verify the external calls.
    verify(emrService).addStepToCluster(emrHiveStepAddRequest);
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(emrHiveStep, result);
}