@Test public void testConversionAzureWithMultipleResourceGroups() { Network network = new Network(); network.setAttributes(new Json(NETWORK_ATTRIBUTES)); dbStack.setNetwork(network); dbStack.setCloudPlatform(CLOUD_PLATFORM); dbStack.setParameters(new HashMap<>()); DatabaseServer server = new DatabaseServer(); server.setDatabaseVendor(DatabaseVendor.POSTGRES); server.setAttributes(new Json(DATABASE_SERVER_ATTRIBUTES)); dbStack.setDatabaseServer(server); dbStack.setTags(new Json(STACK_TAGS)); dbStack.setTemplate("template"); DetailedEnvironmentResponse environmentResponse = new DetailedEnvironmentResponse(); environmentResponse.setCloudPlatform(CLOUD_PLATFORM); environmentResponse.setAzure(AzureEnvironmentParameters.builder() .withAzureResourceGroup(AzureResourceGroup.builder() .withResourceGroupUsage(ResourceGroupUsage.MULTIPLE) .build()) .build()); when(environmentService.getByCrn(anyString())).thenReturn(environmentResponse); DatabaseStack convertedStack = underTest.convert(dbStack); Map<String, Object> parameters = convertedStack.getDatabaseServer().getParameters(); assertFalse(parameters.containsKey(RESOURCE_GROUP_NAME_PARAMETER)); assertFalse(parameters.containsKey(RESOURCE_GROUP_USAGE_PARAMETER)); assertEquals(2, parameters.size()); }
public DatabaseStack convert(DBStack dbStack) { Network network = buildNetwork(dbStack); DatabaseServer databaseServer = buildDatabaseServer(dbStack); return new DatabaseStack(network, databaseServer, getUserDefinedTags(dbStack), dbStack.getTemplate()); }
DBStackToDatabaseStackConverter { public DatabaseStack convert(DBStack dbStack) { Network network = buildNetwork(dbStack); DatabaseServer databaseServer = buildDatabaseServer(dbStack); return new DatabaseStack(network, databaseServer, getUserDefinedTags(dbStack), dbStack.getTemplate()); } }
DBStackToDatabaseStackConverter { public DatabaseStack convert(DBStack dbStack) { Network network = buildNetwork(dbStack); DatabaseServer databaseServer = buildDatabaseServer(dbStack); return new DatabaseStack(network, databaseServer, getUserDefinedTags(dbStack), dbStack.getTemplate()); }  }
DBStackToDatabaseStackConverter { public DatabaseStack convert(DBStack dbStack) { Network network = buildNetwork(dbStack); DatabaseServer databaseServer = buildDatabaseServer(dbStack); return new DatabaseStack(network, databaseServer, getUserDefinedTags(dbStack), dbStack.getTemplate()); }  DatabaseStack convert(DBStack dbStack); }
DBStackToDatabaseStackConverter { public DatabaseStack convert(DBStack dbStack) { Network network = buildNetwork(dbStack); DatabaseServer databaseServer = buildDatabaseServer(dbStack); return new DatabaseStack(network, databaseServer, getUserDefinedTags(dbStack), dbStack.getTemplate()); }  DatabaseStack convert(DBStack dbStack);  }