when(emrHelper.getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId())).thenReturn(awsParamsDto); when(emrHelper.isInstanceDefinitionsEmpty(emrClusterDefinition.getInstanceDefinitions())).thenReturn(false); when(emrHelper.buildEmrClusterName(emrClusterAlternateKeyDto.getNamespace(), emrClusterAlternateKeyDto.getEmrClusterDefinitionName(), verify(emrHelper).getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId()); verify(emrHelper).isInstanceDefinitionsEmpty(emrClusterDefinition.getInstanceDefinitions()); verify(emrPricingHelper).updateEmrClusterDefinitionWithBestPrice(emrClusterAlternateKeyDto, emrClusterDefinition, awsParamsDto);
when(emrHelper.getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId())).thenReturn(awsParamsDto); when(emrHelper.isInstanceDefinitionsEmpty(emrClusterDefinition.getInstanceDefinitions())).thenReturn(false); when(emrHelper.buildEmrClusterName(emrClusterAlternateKeyDto.getNamespace(), emrClusterAlternateKeyDto.getEmrClusterDefinitionName(), verify(emrHelper).getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId()); verify(emrHelper).isInstanceDefinitionsEmpty(emrClusterDefinition.getInstanceDefinitions()); verify(emrPricingHelper).updateEmrClusterDefinitionWithBestPrice(emrClusterAlternateKeyDto, emrClusterDefinition, awsParamsDto);
@Test public void testEmrCreateClusterAwsSpecificStepsImplDryRun() { // Create an AWS params DTO AwsParamsDto awsParamsDto = new AwsParamsDto(); // Create an EMR cluster definition object EmrClusterDefinition emrClusterDefinition = new EmrClusterDefinition(); emrClusterDefinition.setAccountId(AWS_ACCOUNT_ID); emrClusterDefinition.setInstanceDefinitions(new InstanceDefinitions()); // Create an EMR cluster create request EmrClusterCreateRequest emrClusterCreateRequest = new EmrClusterCreateRequest(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, DRY_RUN, emrClusterDefinition); emrClusterCreateRequest.setEmrClusterDefinitionOverride(emrClusterDefinition); // Create an EMR cluster alternate key DTO EmrClusterAlternateKeyDto emrClusterAlternateKeyDto = new EmrClusterAlternateKeyDto(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME); // Create a cluster summary object ClusterSummary clusterSummary = new ClusterSummary(); clusterSummary.setId(EMR_CLUSTER_ID); // Mock the external calls. when(emrHelper.getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId())).thenReturn(awsParamsDto); when(emrHelper.isInstanceDefinitionsEmpty(emrClusterDefinition.getInstanceDefinitions())).thenReturn(false); // Call the method under test. emrHelperServiceImpl.emrCreateClusterAwsSpecificSteps(emrClusterCreateRequest, emrClusterDefinition, emrClusterAlternateKeyDto); // Verify the external calls. verify(emrHelper).getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId()); verify(emrHelper).isInstanceDefinitionsEmpty(emrClusterDefinition.getInstanceDefinitions()); verify(emrPricingHelper).updateEmrClusterDefinitionWithBestPrice(emrClusterAlternateKeyDto, emrClusterDefinition, awsParamsDto); verifyNoMoreInteractionsHelper(); }
when(emrHelper.getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId())).thenReturn(awsParamsDto); when(emrHelper.isInstanceDefinitionsEmpty(emrClusterDefinition.getInstanceDefinitions())).thenReturn(false); when(emrHelper.buildEmrClusterName(emrClusterAlternateKeyDto.getNamespace(), emrClusterAlternateKeyDto.getEmrClusterDefinitionName(), verify(emrHelper).getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId()); verify(emrHelper).isInstanceDefinitionsEmpty(emrClusterDefinition.getInstanceDefinitions()); verify(emrPricingHelper).updateEmrClusterDefinitionWithBestPrice(emrClusterAlternateKeyDto, emrClusterDefinition, awsParamsDto);
EmrClusterAlternateKeyDto emrClusterAlternateKeyDto) AwsParamsDto awsParamsDto = emrHelper.getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId());
EmrClusterAlternateKeyDto emrClusterAlternateKeyDto) AwsParamsDto awsParamsDto = emrHelper.getAwsParamsDtoByAccountId(emrClusterDefinition.getAccountId());
assertTrue(emrCluster.getEmrClusterDefinitionName().equals(emrClusterGet.getEmrClusterDefinitionName())); assertTrue(emrCluster.getEmrClusterName().equals(emrClusterGet.getEmrClusterName())); assertEquals(emrCluster.getEmrClusterDefinition().getAccountId(), AWS_ACCOUNT_ID); assertEquals(AWS_ACCOUNT_ID, emrCluster.getAccountId()); assertTrue(emrCluster.getEmrClusterDefinitionName().equals(emrClusterGet.getEmrClusterDefinitionName())); assertTrue(emrCluster.getEmrClusterName().equals(emrClusterGet.getEmrClusterName())); assertEquals(emrCluster.getEmrClusterDefinition().getAccountId(), AWS_ACCOUNT_ID);
String accountId = emrClusterDefinition.getAccountId();
String accountId = emrClusterDefinition.getAccountId();
if (emrClusterDefinitionOverride.getAccountId() != null) emrClusterDefinition.setAccountId(emrClusterDefinitionOverride.getAccountId());
if (emrClusterDefinitionOverride.getAccountId() != null) emrClusterDefinition.setAccountId(emrClusterDefinitionOverride.getAccountId());
lhsAccountId = this.getAccountId(); String rhsAccountId; rhsAccountId = that.getAccountId(); if (!strategy.equals(LocatorUtils.property(thisLocator, "accountId", lhsAccountId), LocatorUtils.property(thatLocator, "accountId", rhsAccountId), lhsAccountId, rhsAccountId, (this.accountId!= null), (that.accountId!= null))) { return false;
lhsAccountId = this.getAccountId(); String rhsAccountId; rhsAccountId = that.getAccountId(); if (!strategy.equals(LocatorUtils.property(thisLocator, "accountId", lhsAccountId), LocatorUtils.property(thatLocator, "accountId", rhsAccountId), lhsAccountId, rhsAccountId, (this.accountId!= null), (that.accountId!= null))) { return false;
theAccountId = this.getAccountId(); strategy.appendField(locator, this, "accountId", buffer, theAccountId, (this.accountId!= null));
theAccountId = this.getAccountId(); strategy.appendField(locator, this, "accountId", buffer, theAccountId, (this.accountId!= null));
theAccountId = this.getAccountId(); strategy.appendField(locator, this, "accountId", buffer, theAccountId, (this.accountId!= null));
theAccountId = this.getAccountId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "accountId", theAccountId), currentHashCode, theAccountId, (this.accountId!= null));
theAccountId = this.getAccountId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "accountId", theAccountId), currentHashCode, theAccountId, (this.accountId!= null));
theAccountId = this.getAccountId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "accountId", theAccountId), currentHashCode, theAccountId, (this.accountId!= null));
if (accountIdShouldBeCopiedAndSet == Boolean.TRUE) { String sourceAccountId; sourceAccountId = this.getAccountId(); String copyAccountId = ((String) strategy.copy(LocatorUtils.property(locator, "accountId", sourceAccountId), sourceAccountId, (this.accountId!= null))); copy.setAccountId(copyAccountId);