@Test void convertWithNewNetwork() { EnvironmentDto environmentDto = getEnvironmentDto(); environmentDto.getNetwork().getAzure().setNetworkId(null); CreateAzureEnvironmentRequest result = underTest.convert(environmentDto); assertEquals(environmentDto.getCredential().getName(), result.getCredentialName()); assertEquals(environmentDto.getDescription(), result.getDescription()); assertEquals(environmentDto.getName(), result.getEnvironmentName()); assertEquals(environmentDto.getTelemetry().getLogging().getStorageLocation(), result.getLogStorage().getStorageLocationBase()); assertEquals(environmentDto.getTelemetry().getLogging().getAdlsGen2().getManagedIdentity(), result.getLogStorage().getManagedIdentity()); assertEquals(environmentDto.getLocation().getName(), result.getRegion()); assertEquals(environmentDto.getSecurityAccess().getCidr(), result.getSecurityAccess().getCidr()); assertEquals(environmentDto.getSecurityAccess().getDefaultSecurityGroupId(), result.getSecurityAccess().getDefaultSecurityGroupId()); assertEquals(environmentDto.getSecurityAccess().getSecurityGroupIdForKnox(), result.getSecurityAccess().getSecurityGroupIdForKnox()); assertEquals(environmentDto.getNetwork().getNetworkCidr(), result.getNewNetworkParams().getNetworkCidr()); }
public CreateAzureEnvironmentRequest convert(EnvironmentDto source) { CreateAzureEnvironmentRequest environmentRequest = initConversionWithNetwork(source); environmentRequest.setCredentialName(source.getCredential().getName()); environmentRequest.setDescription(source.getDescription()); environmentRequest.setEnvironmentName(source.getName()); environmentRequest.setLogStorage(environmentTelemetryToLogStorageRequest(source.getTelemetry())); environmentRequest.setRegion(source.getLocation().getName()); environmentRequest.setSecurityAccess(environmentSecurityAccessToSecurityAccessRequest(source.getSecurityAccess())); environmentRequest.setPublicKey(source.getAuthentication().getPublicKey()); return environmentRequest; }
EnvironmentDtoToCreateAzureEnvironmentRequestConverter implements EnvironmentDtoToCliRequestConverter { public CreateAzureEnvironmentRequest convert(EnvironmentDto source) { CreateAzureEnvironmentRequest environmentRequest = initConversionWithNetwork(source); environmentRequest.setCredentialName(source.getCredential().getName()); environmentRequest.setDescription(source.getDescription()); environmentRequest.setEnvironmentName(source.getName()); environmentRequest.setLogStorage(environmentTelemetryToLogStorageRequest(source.getTelemetry())); environmentRequest.setRegion(source.getLocation().getName()); environmentRequest.setSecurityAccess(environmentSecurityAccessToSecurityAccessRequest(source.getSecurityAccess())); environmentRequest.setPublicKey(source.getAuthentication().getPublicKey()); return environmentRequest; } }
EnvironmentDtoToCreateAzureEnvironmentRequestConverter implements EnvironmentDtoToCliRequestConverter { public CreateAzureEnvironmentRequest convert(EnvironmentDto source) { CreateAzureEnvironmentRequest environmentRequest = initConversionWithNetwork(source); environmentRequest.setCredentialName(source.getCredential().getName()); environmentRequest.setDescription(source.getDescription()); environmentRequest.setEnvironmentName(source.getName()); environmentRequest.setLogStorage(environmentTelemetryToLogStorageRequest(source.getTelemetry())); environmentRequest.setRegion(source.getLocation().getName()); environmentRequest.setSecurityAccess(environmentSecurityAccessToSecurityAccessRequest(source.getSecurityAccess())); environmentRequest.setPublicKey(source.getAuthentication().getPublicKey()); return environmentRequest; } EnvironmentDtoToCreateAzureEnvironmentRequestConverter(AzureRegistrationTypeResolver azureRegistrationTypeResolver); }
EnvironmentDtoToCreateAzureEnvironmentRequestConverter implements EnvironmentDtoToCliRequestConverter { public CreateAzureEnvironmentRequest convert(EnvironmentDto source) { CreateAzureEnvironmentRequest environmentRequest = initConversionWithNetwork(source); environmentRequest.setCredentialName(source.getCredential().getName()); environmentRequest.setDescription(source.getDescription()); environmentRequest.setEnvironmentName(source.getName()); environmentRequest.setLogStorage(environmentTelemetryToLogStorageRequest(source.getTelemetry())); environmentRequest.setRegion(source.getLocation().getName()); environmentRequest.setSecurityAccess(environmentSecurityAccessToSecurityAccessRequest(source.getSecurityAccess())); environmentRequest.setPublicKey(source.getAuthentication().getPublicKey()); return environmentRequest; } EnvironmentDtoToCreateAzureEnvironmentRequestConverter(AzureRegistrationTypeResolver azureRegistrationTypeResolver); @Override CloudPlatform supportedPlatform(); CreateAzureEnvironmentRequest convert(EnvironmentDto source); }
EnvironmentDtoToCreateAzureEnvironmentRequestConverter implements EnvironmentDtoToCliRequestConverter { public CreateAzureEnvironmentRequest convert(EnvironmentDto source) { CreateAzureEnvironmentRequest environmentRequest = initConversionWithNetwork(source); environmentRequest.setCredentialName(source.getCredential().getName()); environmentRequest.setDescription(source.getDescription()); environmentRequest.setEnvironmentName(source.getName()); environmentRequest.setLogStorage(environmentTelemetryToLogStorageRequest(source.getTelemetry())); environmentRequest.setRegion(source.getLocation().getName()); environmentRequest.setSecurityAccess(environmentSecurityAccessToSecurityAccessRequest(source.getSecurityAccess())); environmentRequest.setPublicKey(source.getAuthentication().getPublicKey()); return environmentRequest; } EnvironmentDtoToCreateAzureEnvironmentRequestConverter(AzureRegistrationTypeResolver azureRegistrationTypeResolver); @Override CloudPlatform supportedPlatform(); CreateAzureEnvironmentRequest convert(EnvironmentDto source);  }