Skip to content

Commit 5477a99

Browse files
authored
CORE-338: fix Azure unit tests, maybe fix live database utils (#1836)
1 parent 2fb17c4 commit 5477a99

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

service/src/main/resources/application.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ env:
3030
tps: ${TPS_ADDRESS:https://tps.dsde-dev.broadinstitute.org/}
3131
lzs: ${LZS_ADDRESS:https://landingzone.dsde-dev.broadinstitute.org/}
3232
azure:
33-
environment: ${AZURE_ENVIRONMENT:AZURE}
33+
environment: ${AZURE_ENVIRONMENT:AzureCloud}
3434
customer:
3535
usage-attribute: ${AZURE_CUSTOMER_USAGE_ATTRIBUTE:}
3636

service/src/test/java/bio/terra/workspace/service/resource/controlled/cloud/azure/database/AzureDatabaseUtilsRunnerTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ public class AzureDatabaseUtilsRunnerTest extends BaseMockitoStrictStubbingTest
4949
@Mock private ApiAzureLandingZoneDeployedResource mockDatabase;
5050
@Mock private ApiAzureLandingZoneDeployedResource mockAdminIdentity;
5151

52+
private final String AZURE_ENV = "AzureCloud";
53+
5254
@BeforeEach
5355
public void createAzureDatabaseUtilsRunner() {
56+
when(mockAzureConfig.getAzureEnvironmentConfigString()).thenReturn(AZURE_ENV);
5457
azureDatabaseUtilsRunner =
5558
new AzureDatabaseUtilsRunner(
5659
mockAzureConfig,
@@ -171,6 +174,8 @@ private void assertResults(Map<String, String> expectedEnv) {
171174
var expectedEnvWithCommon = new HashMap<>(expectedEnv);
172175
expectedEnvWithCommon.putAll(
173176
Map.of(
177+
"AZURE_ENVIRONMENT",
178+
AZURE_ENV,
174179
"DB_SERVER_NAME",
175180
mockDatabase.getResourceId(),
176181
"ADMIN_DB_USER_NAME",

0 commit comments

Comments
 (0)