EmrDaoImpl implements EmrDao { protected VolumeSpecification getVolumeSpecification(EmrClusterDefinitionVolumeSpecification emrClusterDefinitionVolumeSpecification) { VolumeSpecification volumeSpecification = null; if (emrClusterDefinitionVolumeSpecification != null) { volumeSpecification = new VolumeSpecification(); volumeSpecification.setVolumeType(emrClusterDefinitionVolumeSpecification.getVolumeType()); volumeSpecification.setIops(emrClusterDefinitionVolumeSpecification.getIops()); volumeSpecification.setSizeInGB(emrClusterDefinitionVolumeSpecification.getSizeInGB()); } return volumeSpecification; }  @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 testGetVolumeSpecification() { VolumeSpecification result = emrDaoImpl.getVolumeSpecification(new EmrClusterDefinitionVolumeSpecification(VOLUME_TYPE, IOPS, SIZE_IN_GB)); verifyNoMoreInteractionsHelper(); assertEquals(new VolumeSpecification().withVolumeType(VOLUME_TYPE).withIops(IOPS).withSizeInGB(SIZE_IN_GB), result); }
@Test public void testGetVolumeSpecificationWhenInputParameterIsNull() { VolumeSpecification result = emrDaoImpl.getVolumeSpecification(NO_EMR_CLUSTER_DEFINITION_VOLUME_SPECIFICATION); verifyNoMoreInteractionsHelper(); assertNull(result); }