Skip to content

Rename HCP to SAP_CLOUD_PLATFORM, as it is the official name. #9747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public boolean isActive(Environment environment) {
},

/**
* SAP Hana Cloud platform.
* SAP Cloud platform.
*/
HCP {
SAP {

@Override
public boolean isActive(Environment environment) {
Expand All @@ -67,6 +67,7 @@ public boolean isActive(Environment environment) {

/**
* Determines if the platform is active (i.e. the application is running in it).
*
* @param environment the environment
* @return if the platform is active.
*/
Expand All @@ -75,6 +76,7 @@ public boolean isActive(Environment environment) {
/**
* Returns if the platform is behind a load balancer and uses
* {@literal X-Forwarded-For} headers.
*
* @return if {@literal X-Forwarded-For} headers are used
*/
public boolean isUsingForwardHeaders() {
Expand All @@ -83,6 +85,7 @@ public boolean isUsingForwardHeaders() {

/**
* Returns the active {@link CloudPlatform} or {@code null} if one cannot be deduced.
*
* @param environment the environment
* @return the {@link CloudPlatform} or {@code null}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

package org.springframework.boot.cloud;

import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;
import org.springframework.core.env.Environment;
import org.springframework.mock.env.MockEnvironment;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Tests for {@link CloudPlatform}.
*
Expand Down Expand Up @@ -72,11 +71,11 @@ public void getActiveWhenHasDynoShouldReturnHeroku() throws Exception {
}

@Test
public void getActiveWhenHasHcLandscapeShouldReturnHcp() throws Exception {
public void getActiveWhenHasHcLandscapeShouldReturnSap() throws Exception {
Environment environment = new MockEnvironment().withProperty("HC_LANDSCAPE",
"---");
CloudPlatform platform = CloudPlatform.getActive(environment);
assertThat(platform).isEqualTo(CloudPlatform.HCP);
assertThat(platform).isEqualTo(CloudPlatform.SAP);
assertThat(platform.isActive(environment)).isTrue();
}

Expand Down