Skip to content

Commit

Permalink
Adding an AT that checks that a new stack was updated
Browse files Browse the repository at this point in the history
Moving al references to cflinuxfs3
  • Loading branch information
Albertoimpl committed Mar 7, 2024
1 parent 5c74f78 commit d034019
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.Optional;

import com.jayway.jsonpath.DocumentContext;
import org.cloudfoundry.operations.applications.ApplicationDetail;
import org.cloudfoundry.operations.applications.ApplicationSummary;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -68,9 +67,7 @@ protected String backingServiceName() {
"spring.cloud.appbroker.services[0].apps[0].properties.count=2",

"spring.cloud.appbroker.services[0].apps[1].name=" + APP_CREATE_2,
"spring.cloud.appbroker.services[0].apps[1].path=" + BACKING_APP_PATH,

"spring.cloud.appbroker.deployer.cloudfoundry.properties.stack=cflinuxfs3"
"spring.cloud.appbroker.services[0].apps[1].path=" + BACKING_APP_PATH
})
void deployAppsOnCreateService() {
// when a service instance is created
Expand All @@ -88,13 +85,6 @@ void deployAppsOnCreateService() {
assertThat(backingApplication2).hasValueSatisfying(app ->
assertThat(app.getRunningInstances()).isEqualTo(1));


// and stack is updated when specified
Optional<ApplicationDetail> application1Detail = getApplicationDetail(APP_CREATE_1);
assertThat(application1Detail).hasValueSatisfying(app -> {
assertThat(app.getStack()).isEqualTo("cflinuxfs3");
});

// and has the environment variables
DocumentContext json = getSpringAppJson(APP_CREATE_1);
assertEnvironmentVariablesSet(json);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void createsServiceInstance() {
"spring.cloud.appbroker.services[0].apps[0].environment.parameter3=new-config3",
"spring.cloud.appbroker.services[0].apps[0].parameters-transformers[0].name=PropertyMapping",
"spring.cloud.appbroker.services[0].apps[0].parameters-transformers[0].args.include=upgrade",
"spring.cloud.appbroker.deployer.cloudfoundry.properties.stack=cflinuxfs3"
"spring.cloud.appbroker.deployer.cloudfoundry.properties.stack=cflinuxfs4"
})
void upgradesTheServiceInstanceWithNewBackingServiceAndEnvironmentVariables() {
// when the service instance is updated with a new service
Expand All @@ -133,7 +133,7 @@ void upgradesTheServiceInstanceWithNewBackingServiceAndEnvironmentVariables() {
// and stack is updated when specified
Optional<ApplicationDetail> application1Detail = getApplicationDetail(APP_NAME);
assertThat(application1Detail).hasValueSatisfying(app -> {
assertThat(app.getStack()).isEqualTo("cflinuxfs3");
assertThat(app.getStack()).isEqualTo("cflinuxfs4");
});

// then the backing application was updated with zero downtime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void preUpdateAppUpdatesApplicationEnvironment() {
.memoryLimit(100)
.requestedState("STARTED")
.runningInstances(2)
.stack("cflinuxfs3")
.stack("cflinuxfs4")
.build()));

given(clientApplications.summary(argThat(request -> appId.equals(request.getApplicationId()))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"buildpacks": [
"java_buildpack"
],
"stack": "cflinuxfs3"
"stack": "cflinuxfs4"
}
},
"relationships": {
Expand Down

0 comments on commit d034019

Please sign in to comment.