Add SAP Hana Cloud Platform to CloudPlatform

Closes gh-9487
pull/9487/merge
Benjamin Ihrig 8 years ago committed by Stephane Nicoll
parent 303e47f71f
commit 6c270f0e5a

@ -51,6 +51,17 @@ public enum CloudPlatform {
return environment.containsProperty("DYNO");
}
},
/**
* SAP Hana Cloud platform.
*/
HCP {
@Override
public boolean isActive(Environment environment) {
return environment.containsProperty("HC_LANDSCAPE");
}
};
/**

@ -71,4 +71,12 @@ public class CloudPlatformTests {
assertThat(platform.isActive(environment)).isTrue();
}
@Test
public void getActiveWhenHasHcLandscapeShouldReturnHcp() throws Exception {
Environment environment = new MockEnvironment().withProperty("HC_LANDSCAPE", "---");
CloudPlatform platform = CloudPlatform.getActive(environment);
assertThat(platform).isEqualTo(CloudPlatform.HCP);
assertThat(platform.isActive(environment)).isTrue();
}
}

Loading…
Cancel
Save