use of cn.taketoday.core.env.Environment in project today-infrastructure by TAKETODAY.
the class CloudPlatformTests method getActiveWhenHasMissingWebsiteResourceGroupShouldNotReturnAzureAppService.
@Test
void getActiveWhenHasMissingWebsiteResourceGroupShouldNotReturnAzureAppService() {
Map<String, Object> envVars = new HashMap<>();
envVars.put("WEBSITE_SITE_NAME", "---");
envVars.put("WEBSITE_INSTANCE_ID", "1234");
envVars.put("WEBSITE_SKU", "1234");
Environment environment = getEnvironmentWithEnvVariables(envVars);
CloudPlatform platform = CloudPlatform.getActive(environment);
assertThat(platform).isNull();
}
use of cn.taketoday.core.env.Environment in project today-infrastructure by TAKETODAY.
the class CloudPlatformTests method getActiveWhenHasMissingWebsiteInstanceIdShouldNotReturnAzureAppService.
@Test
void getActiveWhenHasMissingWebsiteInstanceIdShouldNotReturnAzureAppService() {
Map<String, Object> envVars = new HashMap<>();
envVars.put("WEBSITE_SITE_NAME", "---");
envVars.put("WEBSITE_RESOURCE_GROUP", "test");
envVars.put("WEBSITE_SKU", "1234");
Environment environment = getEnvironmentWithEnvVariables(envVars);
CloudPlatform platform = CloudPlatform.getActive(environment);
assertThat(platform).isNull();
}
use of cn.taketoday.core.env.Environment in project today-infrastructure by TAKETODAY.
the class CloudPlatformTests method getActiveWhenNotInCloudShouldReturnNull.
@Test
void getActiveWhenNotInCloudShouldReturnNull() {
Environment environment = new MockEnvironment();
CloudPlatform platform = CloudPlatform.getActive(environment);
assertThat(platform).isNull();
}
use of cn.taketoday.core.env.Environment in project today-infrastructure by TAKETODAY.
the class CloudPlatformTests method getActiveWhenHasServiceHostAndNoServicePortShouldNotReturnKubernetes.
@Test
void getActiveWhenHasServiceHostAndNoServicePortShouldNotReturnKubernetes() {
Environment environment = getEnvironmentWithEnvVariables(Collections.singletonMap("EXAMPLE_SERVICE_HOST", "---"));
CloudPlatform platform = CloudPlatform.getActive(environment);
assertThat(platform).isNull();
}
use of cn.taketoday.core.env.Environment in project today-infrastructure by TAKETODAY.
the class CloudPlatformTests method getActiveWhenHasMissingWebsiteSkuShouldNotReturnAzureAppService.
@Test
void getActiveWhenHasMissingWebsiteSkuShouldNotReturnAzureAppService() {
Map<String, Object> envVars = new HashMap<>();
envVars.put("WEBSITE_SITE_NAME", "---");
envVars.put("WEBSITE_INSTANCE_ID", "1234");
envVars.put("WEBSITE_RESOURCE_GROUP", "test");
Environment environment = getEnvironmentWithEnvVariables(envVars);
CloudPlatform platform = CloudPlatform.getActive(environment);
assertThat(platform).isNull();
}
Aggregations