Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c02d5d52
Commit
c02d5d52
authored
Jul 13, 2017
by
Benjamin Ihrig
Committed by
Stephane Nicoll
Jul 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename HCP to SAP
See gh-9747
parent
884e3ecb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
CloudPlatform.java
...in/java/org/springframework/boot/cloud/CloudPlatform.java
+5
-2
CloudPlatformTests.java
...va/org/springframework/boot/cloud/CloudPlatformTests.java
+4
-5
No files found.
spring-boot/src/main/java/org/springframework/boot/cloud/CloudPlatform.java
View file @
c02d5d52
...
@@ -54,9 +54,9 @@ public enum CloudPlatform {
...
@@ -54,9 +54,9 @@ public enum CloudPlatform {
},
},
/**
/**
* SAP
Hana
Cloud platform.
* SAP Cloud platform.
*/
*/
HC
P
{
SA
P
{
@Override
@Override
public
boolean
isActive
(
Environment
environment
)
{
public
boolean
isActive
(
Environment
environment
)
{
...
@@ -67,6 +67,7 @@ public enum CloudPlatform {
...
@@ -67,6 +67,7 @@ public enum CloudPlatform {
/**
/**
* Determines if the platform is active (i.e. the application is running in it).
* Determines if the platform is active (i.e. the application is running in it).
*
* @param environment the environment
* @param environment the environment
* @return if the platform is active.
* @return if the platform is active.
*/
*/
...
@@ -75,6 +76,7 @@ public enum CloudPlatform {
...
@@ -75,6 +76,7 @@ public enum CloudPlatform {
/**
/**
* Returns if the platform is behind a load balancer and uses
* Returns if the platform is behind a load balancer and uses
* {@literal X-Forwarded-For} headers.
* {@literal X-Forwarded-For} headers.
*
* @return if {@literal X-Forwarded-For} headers are used
* @return if {@literal X-Forwarded-For} headers are used
*/
*/
public
boolean
isUsingForwardHeaders
()
{
public
boolean
isUsingForwardHeaders
()
{
...
@@ -83,6 +85,7 @@ public enum CloudPlatform {
...
@@ -83,6 +85,7 @@ public enum CloudPlatform {
/**
/**
* Returns the active {@link CloudPlatform} or {@code null} if one cannot be deduced.
* Returns the active {@link CloudPlatform} or {@code null} if one cannot be deduced.
*
* @param environment the environment
* @param environment the environment
* @return the {@link CloudPlatform} or {@code null}
* @return the {@link CloudPlatform} or {@code null}
*/
*/
...
...
spring-boot/src/test/java/org/springframework/boot/cloud/CloudPlatformTests.java
View file @
c02d5d52
...
@@ -16,13 +16,12 @@
...
@@ -16,13 +16,12 @@
package
org
.
springframework
.
boot
.
cloud
;
package
org
.
springframework
.
boot
.
cloud
;
import
org.junit.Tes
t
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertTha
t
;
import
org.junit.Test
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.mock.env.MockEnvironment
;
import
org.springframework.mock.env.MockEnvironment
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
* Tests for {@link CloudPlatform}.
* Tests for {@link CloudPlatform}.
*
*
...
@@ -72,11 +71,11 @@ public class CloudPlatformTests {
...
@@ -72,11 +71,11 @@ public class CloudPlatformTests {
}
}
@Test
@Test
public
void
getActiveWhenHasHcLandscapeShouldReturn
Hc
p
()
throws
Exception
{
public
void
getActiveWhenHasHcLandscapeShouldReturn
Sa
p
()
throws
Exception
{
Environment
environment
=
new
MockEnvironment
().
withProperty
(
"HC_LANDSCAPE"
,
Environment
environment
=
new
MockEnvironment
().
withProperty
(
"HC_LANDSCAPE"
,
"---"
);
"---"
);
CloudPlatform
platform
=
CloudPlatform
.
getActive
(
environment
);
CloudPlatform
platform
=
CloudPlatform
.
getActive
(
environment
);
assertThat
(
platform
).
isEqualTo
(
CloudPlatform
.
HC
P
);
assertThat
(
platform
).
isEqualTo
(
CloudPlatform
.
SA
P
);
assertThat
(
platform
.
isActive
(
environment
)).
isTrue
();
assertThat
(
platform
.
isActive
(
environment
)).
isTrue
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment