@Test
public void testLogEmrClusterCreationImpl() throws Exception
{

    // Create a namespace entity.
    NamespaceEntity namespaceEntity = new NamespaceEntity();
    namespaceEntity.setCode(NAMESPACE);
    // Create an EMR cluster alternate key DTO
    EmrClusterAlternateKeyDto emrClusterAlternateKeyDto = new EmrClusterAlternateKeyDto(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME);
    // Create an EMR cluster definition object
    EmrClusterDefinition emrClusterDefinition = new EmrClusterDefinition();
    // Mock the external calls.
    when(namespaceDaoHelper.getNamespaceEntity(NAMESPACE)).thenReturn(namespaceEntity);
    when(xmlHelper.objectToXml(emrClusterDefinition)).thenReturn(EMR_CLUSTER_DEFINITION_XML_FILE_MINIMAL_CLASSPATH);
    // Call the method under test.
    emrHelperServiceImpl.logEmrClusterCreation(emrClusterAlternateKeyDto, emrClusterDefinition, EMR_CLUSTER_ID);
    // Verify the external calls.
    verify(namespaceDaoHelper).getNamespaceEntity(NAMESPACE);
    verify(xmlHelper).objectToXml(emrClusterDefinition);
    verify(herdDao).saveAndRefresh(any(EmrClusterCreationLogEntity.class));
    verifyNoMoreInteractionsHelper();
}