|
|
|
@ -50,7 +50,33 @@ class CloudPlatformTests {
|
|
|
|
|
Environment environment = new MockEnvironment();
|
|
|
|
|
CloudPlatform platform = CloudPlatform.getActive(environment);
|
|
|
|
|
assertThat(platform).isNull();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void getActiveWhenHasWebsiteSiteNameAndWebsitesEnableAppServiceStorageShouldReturnAzureAppService() {
|
|
|
|
|
Map<String, Object> envVars = new HashMap<>();
|
|
|
|
|
envVars.put("WEBSITE_SITE_NAME", "---");
|
|
|
|
|
envVars.put("WEBSITES_ENABLE_APP_SERVICE_STORAGE", "false");
|
|
|
|
|
Environment environment = getEnvironmentWithEnvVariables(envVars);
|
|
|
|
|
CloudPlatform platform = CloudPlatform.getActive(environment);
|
|
|
|
|
assertThat(platform).isEqualTo(CloudPlatform.AZURE_APP_SERVICE);
|
|
|
|
|
assertThat(platform.isActive(environment)).isTrue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void getActiveWhenHasWebsiteSiteNameShouldReturnNull() {
|
|
|
|
|
Environment environment = getEnvironmentWithEnvVariables(
|
|
|
|
|
Collections.singletonMap("WEBSITE_SITE_NAME", "---"));
|
|
|
|
|
CloudPlatform platform = CloudPlatform.getActive(environment);
|
|
|
|
|
assertThat(platform).isNull();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void getActiveWhenHasWebsitesEnableAppServiceStorageShouldReturnNull() {
|
|
|
|
|
Environment environment = getEnvironmentWithEnvVariables(
|
|
|
|
|
Collections.singletonMap("WEBSITES_ENABLE_APP_SERVICE_STORAGE", "---"));
|
|
|
|
|
CloudPlatform platform = CloudPlatform.getActive(environment);
|
|
|
|
|
assertThat(platform).isNull();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|