Skip to content

Commit dc6c0c8

Browse files
committed
Updating CFJC to 5.1
Updating compatibility matrix with SCOSB and OSBAPI versions Updating default buildpack to empty String. Nulls are not allowed by operations and the only way to enable autodiscovery is by passing and empty list, passing an empty String will trigget that behaviour. Updating tests to document the default buildpack
1 parent 8a8e17b commit dc6c0c8

File tree

7 files changed

+107
-3
lines changed

7 files changed

+107
-3
lines changed

README.adoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ Join us in our gitter channel: https://gitter.im/spring-cloud-app-broker/communi
2222

2323
=== Compatibility
2424

25+
==== 1.3.x
26+
27+
* https://projects.spring.io/spring-framework/[Spring Framework] 5.3.x
28+
* https://projects.spring.io/spring-boot/[Spring Boot] 2.4.x
29+
* https://github.com/cloudfoundry/cf-java-client/[Cloud Foundry Java Client] 5.x
30+
* https://github.com/reactor/[Reactor] 3.4.x
31+
* https://spring.io/projects/spring-cloud-open-service-broker/[Spring Cloud Open Service Broker] 3.3.x
32+
* https://github.com/openservicebrokerapi/servicebroker/tree/v2.15/[Open Service Broker API] 2.15
33+
34+
==== 1.2.x
35+
36+
* https://projects.spring.io/spring-framework/[Spring Framework] 5.2.x
37+
* https://projects.spring.io/spring-boot/[Spring Boot] 2.3.x
38+
* https://github.com/cloudfoundry/cf-java-client/[Cloud Foundry Java Client] 4.x
39+
* https://github.com/reactor/[Reactor] 3.3.x
40+
* https://spring.io/projects/spring-cloud-open-service-broker/[Spring Cloud Open Service Broker] 3.3.x
41+
* https://github.com/openservicebrokerapi/servicebroker/tree/v2.15/[Open Service Broker API] 2.15
42+
2543
==== 1.1.x
2644

2745
* https://projects.spring.io/spring-framework/[Spring Framework] 5.2.x

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ onlyShowStandardStreamsOnTestFailure = false
55

66
awaitilityVersion = 4.0.2
77
blockHoundVersion = 1.0.4.RELEASE
8-
cfJavaClientVersion = 4.7.0.RELEASE
8+
cfJavaClientVersion = 5.1.0.RELEASE
99
checkstyleVersion = 8.37
1010
commonsTextVersion = 1.8
1111
immutablesVersion = 2.8.8

spring-cloud-app-broker-deployer-cloudfoundry/src/main/java/org/springframework/cloud/appbroker/deployer/cloudfoundry/CloudFoundryDeploymentProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public class CloudFoundryDeploymentProperties extends DeploymentProperties {
114114
/**
115115
* The buildpack to use for deploying the application.
116116
*/
117-
private String buildpack;
117+
private String buildpack = "";
118118

119119
/**
120120
* The type of health check to perform on deployed application, if not overridden per-app. Defaults to PORT

spring-cloud-app-broker-deployer-cloudfoundry/src/test/java/org/springframework/cloud/appbroker/deployer/cloudfoundry/CloudFoundryAppDeployerTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class CloudFoundryAppDeployerTest {
154154
@BeforeEach
155155
void setUp() {
156156
deploymentProperties = new CloudFoundryDeploymentProperties();
157+
157158
CloudFoundryTargetProperties targetProperties = new CloudFoundryTargetProperties();
158159
targetProperties.setDefaultOrg("default-org");
159160
targetProperties.setDefaultSpace("default-space");
@@ -193,6 +194,7 @@ void deployAppWithPlatformDefaults() {
193194
ApplicationManifest expectedManifest = baseManifestWithSpringAppJson()
194195
.name(APP_NAME)
195196
.path(new File(APP_PATH).toPath())
197+
.buildpacks("") // Empty list means to discover the buildpack
196198
.build();
197199

198200
then(operationsApplications).should().pushManifest(argThat(matchesManifest(expectedManifest)));
@@ -436,6 +438,7 @@ void deployAppWithEnvironmentUsingSpringAppJson() {
436438
"\"ENV_VAR_2\":\"value2\",\"ENV_VAR_1\":\"value1\"")
437439
.name(APP_NAME)
438440
.path(new File(APP_PATH).toPath())
441+
.buildpacks("")
439442
.environmentVariable("JAVA_OPTS", "-Xms512m -Xmx1024m")
440443
.build();
441444

@@ -462,6 +465,7 @@ void deployAppWithEnvironmentNotUsingSpringAppJson() {
462465
ApplicationManifest expectedManifest = baseManifest()
463466
.name(APP_NAME)
464467
.path(new File(APP_PATH).toPath())
468+
.buildpack("")
465469
.environmentVariable("JAVA_OPTS", "-Xms512m -Xmx1024m")
466470
.environmentVariable("spring.cloud.appbroker.service-instance-id", SERVICE_INSTANCE_ID)
467471
.environmentVariable("ENV_VAR_1", "value1")

spring-cloud-app-broker-integration-tests/src/test/java/org/springframework/cloud/appbroker/integration/WiremockComponentTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"spring.cloud.appbroker.deployer.cloudfoundry.password=adminpass",
5151
"spring.cloud.appbroker.deployer.cloudfoundry.default-org=test",
5252
"spring.cloud.appbroker.deployer.cloudfoundry.default-space=development",
53-
"spring.cloud.appbroker.deployer.cloudfoundry.secure=false"
53+
"spring.cloud.appbroker.deployer.cloudfoundry.secure=false",
54+
"spring.cloud.appbroker.deployer.cloudfoundry.properties.buildpack=example-buildpack"
5455
}
5556
)
5657
@ActiveProfiles("openservicebroker-catalog")

spring-cloud-app-broker-integration-tests/src/test/java/org/springframework/cloud/appbroker/integration/fixtures/CloudControllerStubFixture.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ public void stubPushAppWithHost(final String appName, final String host, Content
236236
}
237237

238238
public void stubUpdateAppWithUpgrade(final String appName) {
239+
stubGetV3App(appName);
239240
stubUpdateEnvironment(appName);
240241
stubCreatePackage(appName);
241242
stubCreateBuild(appName);
@@ -248,12 +249,22 @@ public void stubUpdateAppWithHostAndDomain(final String appName) {
248249
}
249250

250251
public void stubUpdateApp(final String appName) {
252+
stubGetV3App(appName);
251253
stubUpdateEnvironment(appName);
252254
stubGetPackage(appName);
253255
stubCreateBuild(appName);
254256
stubCreateDeployment(appName);
255257
}
256258

259+
private void stubGetV3App(String appName) {
260+
stubFor(get(urlPathEqualTo("/v3/apps/" + appGuid(appName)))
261+
.willReturn(ok()
262+
.withBody(cc("get-v3-app-STARTED",
263+
replace("@name", appName),
264+
replace("@guid", appGuid(appName))
265+
))));
266+
}
267+
257268
private void stubAppAfterCreation(String appName, String host) {
258269
stubMapRouteToApp(appName, host);
259270
stubUploadAppBits(appName);
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"guid": "@guid",
3+
"name": "@name",
4+
"state": "STARTED",
5+
"created_at": "2016-03-17T21:41:30Z",
6+
"updated_at": "2016-06-08T16:41:26Z",
7+
"lifecycle": {
8+
"type": "buildpack",
9+
"data": {
10+
"buildpacks": [
11+
"java_buildpack"
12+
],
13+
"stack": "cflinuxfs3"
14+
}
15+
},
16+
"relationships": {
17+
"space": {
18+
"data": {
19+
"guid": "@space-guid"
20+
}
21+
}
22+
},
23+
"links": {
24+
"self": {
25+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446"
26+
},
27+
"space": {
28+
"href": "https://api.example.org/v3/spaces/2f35885d-0c9d-4423-83ad-fd05066f8576"
29+
},
30+
"processes": {
31+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/processes"
32+
},
33+
"packages": {
34+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/packages"
35+
},
36+
"environment_variables": {
37+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/environment_variables"
38+
},
39+
"current_droplet": {
40+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/droplets/current"
41+
},
42+
"droplets": {
43+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/droplets"
44+
},
45+
"tasks": {
46+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/tasks"
47+
},
48+
"start": {
49+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/actions/start",
50+
"method": "POST"
51+
},
52+
"stop": {
53+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/actions/stop",
54+
"method": "POST"
55+
},
56+
"revisions": {
57+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/revisions"
58+
},
59+
"deployed_revisions": {
60+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/revisions/deployed"
61+
},
62+
"features": {
63+
"href": "https://api.example.org/v3/apps/1cb006ee-fb05-47e1-b541-c34179ddc446/features"
64+
}
65+
},
66+
"metadata": {
67+
"labels": {},
68+
"annotations": {}
69+
}
70+
}

0 commit comments

Comments
 (0)