EmrHelperServiceImpl implements EmrHelperService { void logEmrClusterCreationImpl(EmrClusterAlternateKeyDto emrClusterAlternateKeyDto, EmrClusterDefinition emrClusterDefinition, String clusterId) throws Exception { EmrClusterCreationLogEntity emrClusterCreationLogEntity = new EmrClusterCreationLogEntity(); emrClusterCreationLogEntity.setNamespace(namespaceDaoHelper.getNamespaceEntity(emrClusterAlternateKeyDto.getNamespace())); emrClusterCreationLogEntity.setEmrClusterDefinitionName(emrClusterAlternateKeyDto.getEmrClusterDefinitionName()); emrClusterCreationLogEntity.setEmrClusterName(emrClusterAlternateKeyDto.getEmrClusterName()); emrClusterCreationLogEntity.setEmrClusterId(clusterId); emrClusterCreationLogEntity.setEmrClusterDefinition(xmlHelper.objectToXml(emrClusterDefinition)); herdDao.saveAndRefresh(emrClusterCreationLogEntity); }  @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) EmrClusterCreateDto emrCreateClusterAwsSpecificSteps(EmrClusterCreateRequest emrClusterCreateRequest, EmrClusterDefinition emrClusterDefinition,
        EmrClusterAlternateKeyDto emrClusterAlternateKeyDto, EmrParamsDto emrParamsDto); @Override @Transactional(propagation = Propagation.REQUIRES_NEW) EmrClusterPreCreateDto emrPreCreateClusterSteps(EmrClusterAlternateKeyDto emrClusterAlternateKeyDto, EmrClusterCreateRequest emrClusterCreateRequest); @Override @Transactional(propagation = Propagation.REQUIRES_NEW) void logEmrClusterCreation(EmrClusterAlternateKeyDto emrClusterAlternateKeyDto, EmrClusterDefinition emrClusterDefinition, String clusterId);  }
@Test public void testLogEmrClusterCreationImpl() throws Exception { NamespaceEntity namespaceEntity = new NamespaceEntity(); namespaceEntity.setCode(NAMESPACE); EmrClusterAlternateKeyDto emrClusterAlternateKeyDto = new EmrClusterAlternateKeyDto(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME); EmrClusterDefinition emrClusterDefinition = new EmrClusterDefinition(); when(namespaceDaoHelper.getNamespaceEntity(NAMESPACE)).thenReturn(namespaceEntity); when(xmlHelper.objectToXml(emrClusterDefinition)).thenReturn(EMR_CLUSTER_DEFINITION_XML_FILE_MINIMAL_CLASSPATH); emrHelperServiceImpl.logEmrClusterCreation(emrClusterAlternateKeyDto, emrClusterDefinition, EMR_CLUSTER_ID); verify(namespaceDaoHelper).getNamespaceEntity(NAMESPACE); verify(xmlHelper).objectToXml(emrClusterDefinition); verify(herdDao).saveAndRefresh(any(EmrClusterCreationLogEntity.class)); verifyNoMoreInteractionsHelper(); }