File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
main/java/org/springframework/boot/cloud
test/java/org/springframework/boot/cloud Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ public boolean isActive(Environment environment) {
54
54
},
55
55
56
56
/**
57
- * SAP Hana Cloud platform.
57
+ * SAP Cloud platform.
58
58
*/
59
- HCP {
59
+ SAP {
60
60
61
61
@ Override
62
62
public boolean isActive (Environment environment ) {
@@ -67,6 +67,7 @@ public boolean isActive(Environment environment) {
67
67
68
68
/**
69
69
* Determines if the platform is active (i.e. the application is running in it).
70
+ *
70
71
* @param environment the environment
71
72
* @return if the platform is active.
72
73
*/
@@ -75,6 +76,7 @@ public boolean isActive(Environment environment) {
75
76
/**
76
77
* Returns if the platform is behind a load balancer and uses
77
78
* {@literal X-Forwarded-For} headers.
79
+ *
78
80
* @return if {@literal X-Forwarded-For} headers are used
79
81
*/
80
82
public boolean isUsingForwardHeaders () {
@@ -83,6 +85,7 @@ public boolean isUsingForwardHeaders() {
83
85
84
86
/**
85
87
* Returns the active {@link CloudPlatform} or {@code null} if one cannot be deduced.
88
+ *
86
89
* @param environment the environment
87
90
* @return the {@link CloudPlatform} or {@code null}
88
91
*/
Original file line number Diff line number Diff line change 16
16
17
17
package org .springframework .boot .cloud ;
18
18
19
- import org .junit . Test ;
19
+ import static org .assertj . core . api . Assertions . assertThat ;
20
20
21
+ import org .junit .Test ;
21
22
import org .springframework .core .env .Environment ;
22
23
import org .springframework .mock .env .MockEnvironment ;
23
24
24
- import static org .assertj .core .api .Assertions .assertThat ;
25
-
26
25
/**
27
26
* Tests for {@link CloudPlatform}.
28
27
*
@@ -72,11 +71,11 @@ public void getActiveWhenHasDynoShouldReturnHeroku() throws Exception {
72
71
}
73
72
74
73
@ Test
75
- public void getActiveWhenHasHcLandscapeShouldReturnHcp () throws Exception {
74
+ public void getActiveWhenHasHcLandscapeShouldReturnSap () throws Exception {
76
75
Environment environment = new MockEnvironment ().withProperty ("HC_LANDSCAPE" ,
77
76
"---" );
78
77
CloudPlatform platform = CloudPlatform .getActive (environment );
79
- assertThat (platform ).isEqualTo (CloudPlatform .HCP );
78
+ assertThat (platform ).isEqualTo (CloudPlatform .SAP );
80
79
assertThat (platform .isActive (environment )).isTrue ();
81
80
}
82
81
You can’t perform that action at this time.
0 commit comments