EmrDaoImpl implements EmrDao { protected OnDemandProvisioningSpecification getOnDemandSpecification(EmrClusterDefinitionOnDemandSpecification emrClusterDefinitionOnDemandSpecification) { OnDemandProvisioningSpecification onDemandProvisioningSpecification = null; if (emrClusterDefinitionOnDemandSpecification != null) { onDemandProvisioningSpecification = new OnDemandProvisioningSpecification(); onDemandProvisioningSpecification.setAllocationStrategy(emrClusterDefinitionOnDemandSpecification.getAllocationStrategy()); } return onDemandProvisioningSpecification; }  @Override String addEmrStep(String clusterId, StepConfig emrStepConfig, AwsParamsDto awsParamsDto); @Override String createEmrCluster(String clusterName, EmrClusterDefinition emrClusterDefinition, EmrParamsDto emrParamsDto); @Override synchronized ClusterSummary getActiveEmrClusterByNameAndAccountId(String clusterName, String accountId, AwsParamsDto awsParams); List<Application> getApplications(List<EmrClusterDefinitionApplication> emrClusterDefinitionApplications); @Override StepSummary getClusterActiveStep(String clusterId, AwsParamsDto awsParamsDto); @Override Step getClusterStep(String clusterId, String stepId, AwsParamsDto awsParamsDto); @Override AmazonElasticMapReduceClient getEmrClient(AwsParamsDto awsParamsDto); @Override Cluster getEmrClusterById(String clusterId, AwsParamsDto awsParams); @Override String getEmrClusterStatusById(String clusterId, AwsParamsDto awsParams); @Override Instance getEmrMasterInstance(String clusterId, AwsParamsDto awsParams); @Override ListInstanceFleetsResult getListInstanceFleetsResult(String clusterId, AwsParamsDto awsParams); @Override void terminateEmrCluster(String clusterId, boolean overrideTerminationProtection, AwsParamsDto awsParams);  }
@Test public void testGetOnDemandSpecification() { final EmrClusterDefinitionOnDemandSpecification emrClusterDefinitionOnDemandSpecification = new EmrClusterDefinitionOnDemandSpecification(ALLOCATION_STRATEGY_1); OnDemandProvisioningSpecification result = emrDaoImpl.getOnDemandSpecification(emrClusterDefinitionOnDemandSpecification); verifyNoMoreInteractionsHelper(); assertEquals(new OnDemandProvisioningSpecification().withAllocationStrategy(ALLOCATION_STRATEGY_1), result); }
@Test public void testGetOnDemandSpecificationWhenEmrClusterDefinitionOnDemandSpecificationIsNull() { OnDemandProvisioningSpecification result = emrDaoImpl.getOnDemandSpecification(null); verifyNoMoreInteractionsHelper(); assertNull(result); }