@@ -50,7 +50,33 @@ void getActiveWhenNotInCloudShouldReturnNull() {
5050 Environment environment = new MockEnvironment ();
5151 CloudPlatform platform = CloudPlatform .getActive (environment );
5252 assertThat (platform ).isNull ();
53+ }
54+
55+ @ Test
56+ void getActiveWhenHasWebsiteSiteNameAndWebsitesEnableAppServiceStorageShouldReturnAzureAppService () {
57+ Map <String , Object > envVars = new HashMap <>();
58+ envVars .put ("WEBSITE_SITE_NAME" , "---" );
59+ envVars .put ("WEBSITES_ENABLE_APP_SERVICE_STORAGE" , "false" );
60+ Environment environment = getEnvironmentWithEnvVariables (envVars );
61+ CloudPlatform platform = CloudPlatform .getActive (environment );
62+ assertThat (platform ).isEqualTo (CloudPlatform .AZURE_APP_SERVICE );
63+ assertThat (platform .isActive (environment )).isTrue ();
64+ }
65+
66+ @ Test
67+ void getActiveWhenHasWebsiteSiteNameShouldReturnNull () {
68+ Environment environment = getEnvironmentWithEnvVariables (
69+ Collections .singletonMap ("WEBSITE_SITE_NAME" , "---" ));
70+ CloudPlatform platform = CloudPlatform .getActive (environment );
71+ assertThat (platform ).isNull ();
72+ }
5373
74+ @ Test
75+ void getActiveWhenHasWebsitesEnableAppServiceStorageShouldReturnNull () {
76+ Environment environment = getEnvironmentWithEnvVariables (
77+ Collections .singletonMap ("WEBSITES_ENABLE_APP_SERVICE_STORAGE" , "---" ));
78+ CloudPlatform platform = CloudPlatform .getActive (environment );
79+ assertThat (platform ).isNull ();
5480 }
5581
5682 @ Test
0 commit comments