From c02d5d52c6cbc2ee7a4b04eae29d17b698b9fa2e Mon Sep 17 00:00:00 2001 From: Benjamin Ihrig Date: Thu, 13 Jul 2017 09:17:47 +0200 Subject: [PATCH] Rename HCP to SAP See gh-9747 --- .../org/springframework/boot/cloud/CloudPlatform.java | 7 +++++-- .../springframework/boot/cloud/CloudPlatformTests.java | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/cloud/CloudPlatform.java b/spring-boot/src/main/java/org/springframework/boot/cloud/CloudPlatform.java index 106b327028..46729ebbaf 100644 --- a/spring-boot/src/main/java/org/springframework/boot/cloud/CloudPlatform.java +++ b/spring-boot/src/main/java/org/springframework/boot/cloud/CloudPlatform.java @@ -54,9 +54,9 @@ public enum CloudPlatform { }, /** - * SAP Hana Cloud platform. + * SAP Cloud platform. */ - HCP { + SAP { @Override public boolean isActive(Environment environment) { @@ -67,6 +67,7 @@ public enum CloudPlatform { /** * Determines if the platform is active (i.e. the application is running in it). + * * @param environment the environment * @return if the platform is active. */ @@ -75,6 +76,7 @@ public enum CloudPlatform { /** * 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() { @@ -83,6 +85,7 @@ public enum CloudPlatform { /** * Returns the active {@link CloudPlatform} or {@code null} if one cannot be deduced. + * * @param environment the environment * @return the {@link CloudPlatform} or {@code null} */ diff --git a/spring-boot/src/test/java/org/springframework/boot/cloud/CloudPlatformTests.java b/spring-boot/src/test/java/org/springframework/boot/cloud/CloudPlatformTests.java index a5bc6c84e0..de97d5853d 100644 --- a/spring-boot/src/test/java/org/springframework/boot/cloud/CloudPlatformTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/cloud/CloudPlatformTests.java @@ -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}. * @@ -72,11 +71,11 @@ public class CloudPlatformTests { } @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(); }