|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2020 the original author or authors. |
| 2 | + * Copyright 2012-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -50,7 +50,6 @@ void getActiveWhenNotInCloudShouldReturnNull() {
|
50 | 50 | Environment environment = new MockEnvironment();
|
51 | 51 | CloudPlatform platform = CloudPlatform.getActive(environment);
|
52 | 52 | assertThat(platform).isNull();
|
53 |
| - |
54 | 53 | }
|
55 | 54 |
|
56 | 55 | @Test
|
@@ -131,6 +130,32 @@ void getActiveWhenHasServiceHostAndNoServicePortShouldNotReturnKubernetes() {
|
131 | 130 | assertThat(platform).isNull();
|
132 | 131 | }
|
133 | 132 |
|
| 133 | + @Test |
| 134 | + void getActiveWhenHasWebsiteSiteNameAndWebsitesEnableAppServiceStorageShouldReturnAzureAppService() { |
| 135 | + Map<String, Object> envVars = new HashMap<>(); |
| 136 | + envVars.put("WEBSITE_SITE_NAME", "---"); |
| 137 | + envVars.put("WEBSITES_ENABLE_APP_SERVICE_STORAGE", "false"); |
| 138 | + Environment environment = getEnvironmentWithEnvVariables(envVars); |
| 139 | + CloudPlatform platform = CloudPlatform.getActive(environment); |
| 140 | + assertThat(platform).isEqualTo(CloudPlatform.AZURE_APP_SERVICE); |
| 141 | + assertThat(platform.isActive(environment)).isTrue(); |
| 142 | + } |
| 143 | + |
| 144 | + @Test |
| 145 | + void getActiveWhenHasWebsiteSiteNameAndNoWebsitesEnableAppServiceStorageShouldNotReturnAzureAppService() { |
| 146 | + Environment environment = getEnvironmentWithEnvVariables(Collections.singletonMap("WEBSITE_SITE_NAME", "---")); |
| 147 | + CloudPlatform platform = CloudPlatform.getActive(environment); |
| 148 | + assertThat(platform).isNull(); |
| 149 | + } |
| 150 | + |
| 151 | + @Test |
| 152 | + void getActiveWhenHasWebsitesEnableAppServiceStorageAndNoWebsiteNameShouldNotReturnAzureAppService() { |
| 153 | + Environment environment = getEnvironmentWithEnvVariables( |
| 154 | + Collections.singletonMap("WEBSITES_ENABLE_APP_SERVICE_STORAGE", "---")); |
| 155 | + CloudPlatform platform = CloudPlatform.getActive(environment); |
| 156 | + assertThat(platform).isNull(); |
| 157 | + } |
| 158 | + |
134 | 159 | @Test
|
135 | 160 | void getActiveWhenHasEnforcedCloudPlatform() {
|
136 | 161 | Environment environment = getEnvironmentWithEnvVariables(
|
|
0 commit comments