Skip to content

Commit c02d5d5

Browse files
ihrigbsnicoll
authored andcommitted
Rename HCP to SAP
See gh-9747
1 parent 884e3ec commit c02d5d5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

spring-boot/src/main/java/org/springframework/boot/cloud/CloudPlatform.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public boolean isActive(Environment environment) {
5454
},
5555

5656
/**
57-
* SAP Hana Cloud platform.
57+
* SAP Cloud platform.
5858
*/
59-
HCP {
59+
SAP {
6060

6161
@Override
6262
public boolean isActive(Environment environment) {
@@ -67,6 +67,7 @@ public boolean isActive(Environment environment) {
6767

6868
/**
6969
* Determines if the platform is active (i.e. the application is running in it).
70+
*
7071
* @param environment the environment
7172
* @return if the platform is active.
7273
*/
@@ -75,6 +76,7 @@ public boolean isActive(Environment environment) {
7576
/**
7677
* Returns if the platform is behind a load balancer and uses
7778
* {@literal X-Forwarded-For} headers.
79+
*
7880
* @return if {@literal X-Forwarded-For} headers are used
7981
*/
8082
public boolean isUsingForwardHeaders() {
@@ -83,6 +85,7 @@ public boolean isUsingForwardHeaders() {
8385

8486
/**
8587
* Returns the active {@link CloudPlatform} or {@code null} if one cannot be deduced.
88+
*
8689
* @param environment the environment
8790
* @return the {@link CloudPlatform} or {@code null}
8891
*/

spring-boot/src/test/java/org/springframework/boot/cloud/CloudPlatformTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616

1717
package org.springframework.boot.cloud;
1818

19-
import org.junit.Test;
19+
import static org.assertj.core.api.Assertions.assertThat;
2020

21+
import org.junit.Test;
2122
import org.springframework.core.env.Environment;
2223
import org.springframework.mock.env.MockEnvironment;
2324

24-
import static org.assertj.core.api.Assertions.assertThat;
25-
2625
/**
2726
* Tests for {@link CloudPlatform}.
2827
*
@@ -72,11 +71,11 @@ public void getActiveWhenHasDynoShouldReturnHeroku() throws Exception {
7271
}
7372

7473
@Test
75-
public void getActiveWhenHasHcLandscapeShouldReturnHcp() throws Exception {
74+
public void getActiveWhenHasHcLandscapeShouldReturnSap() throws Exception {
7675
Environment environment = new MockEnvironment().withProperty("HC_LANDSCAPE",
7776
"---");
7877
CloudPlatform platform = CloudPlatform.getActive(environment);
79-
assertThat(platform).isEqualTo(CloudPlatform.HCP);
78+
assertThat(platform).isEqualTo(CloudPlatform.SAP);
8079
assertThat(platform.isActive(environment)).isTrue();
8180
}
8281

0 commit comments

Comments
 (0)