Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(2.2.x): Upgrading cfJavaClientVersion to 5.12.1.RELEASE #1056

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import java.util.concurrent.ConcurrentHashMap
buildscript {
ext {
blockHoundVersion = "1.0.9.RELEASE"
cfJavaClientVersion = "5.10.0.RELEASE"
cfJavaClientVersion = "5.12.1.RELEASE"
commonsTextVersion = "1.12.0"
immutablesVersion = "2.10.1"
openServiceBrokerVersion = "4.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class CreateInstanceComponentTest extends WiremockComponentTest {

@Test
void pushAppsWhenTheyDoNotExist() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME_1);
cloudControllerFixture.stubPushApp(APP_NAME_1,
matchingJsonPath("$.environment_json[?(@.SPRING_APPLICATION_JSON =~ " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class CreateInstanceWithCustomParametersMappingComponentTest extends WiremockCom

@Test
void pushAppWithParametersTransformedUsingCustomTransformer() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME);
cloudControllerFixture.stubPushApp(APP_NAME,
matchingJsonPath(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ void pushAppWithServicesInSpace() {
String serviceInstanceId = "instance-id";
String customSpace = "my-space";
String customSpaceGuid = "my-space-guid";

cloudControllerFixture.stubFindTestOrg();
cloudControllerFixture.stubFindSpaceV3(customSpace, customSpaceGuid);
cloudControllerFixture.stubCreateSpace(customSpace, customSpaceGuid);
cloudControllerFixture.stubAssociatePermissions(customSpace, customSpaceGuid);
cloudControllerFixture.stubAssociatePermissions();
cloudControllerFixture.stubPushApp(APP_NAME);

// given services are available in the marketplace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class CreateInstanceWithEnvironmentComponentTest extends WiremockComponentTest {

@Test
void pushAppWithEnvironmentVariables() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME_1);
cloudControllerFixture.stubPushApp(APP_NAME_1,
matchingJsonPath("$.environment_json[?(@.SPRING_APPLICATION_JSON =~ /.*ENV_VAR_1.*:.*value1.*/)]"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class CreateInstanceWithExistingServicesComponentTest extends WiremockComponentT

@Test
void pushAppWithServicesWhenServicesExist() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME);
cloudControllerFixture.stubPushApp(APP_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CreateInstanceWithOnlyABackingServiceComponentTest extends WiremockCompone

@Test
void createsServicesWhenOnlyBackingServiceIsRequested() {

cloudControllerFixture.stubFindSpaceV3();
// given services are available in the marketplace
cloudControllerFixture.stubServiceExists(BACKING_SERVICE_NAME, BACKING_PLAN_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class CreateInstanceWithParametersMappingComponentTest extends WiremockComponent

@Test
void pushAppWithParametersTransformedToEnvironmentVariables() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME);
cloudControllerFixture.stubPushApp(APP_NAME,
matchingJsonPath("$.environment_json[?(@.SPRING_APPLICATION_JSON =~ /.*parameter1.*:.*value1.*/)]"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class CreateInstanceWithPropertiesComponentTest extends WiremockComponentTest {

@Test
void pushAppWithProperties() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME);
cloudControllerFixture.stubPushApp(APP_NAME,
matchingJsonPath("$.[?(@.memory == '2048')]"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void deployAppsWithServiceInstanceGuidSuffixOnCreateServiceWhenCreatingMoreThanO
String applicationName = APP_NAME + "-" + serviceInstanceId;
String backingServiceInstanceName = BACKING_SI_NAME + "-" + serviceInstanceId;

cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(applicationName);
cloudControllerFixture.stubPushApp(applicationName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class CreateInstanceWithServicesComponentTest extends WiremockComponentTest {

@Test
void pushAppWithServicesWhenServicesExist() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME);
cloudControllerFixture.stubPushApp(APP_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class CreateInstanceWithServicesParametersComponentTest extends WiremockComponen

@Test
void pushAppWithBackingServicesParameters() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME);
cloudControllerFixture.stubPushApp(APP_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ void pushAppWithServicesInSpace() {
String serviceInstanceId = "instance-id";
String backingSpaceGuid = "my-space-guid";

cloudControllerFixture.stubFindTestOrg();
cloudControllerFixture.stubFindSpaceV3(serviceInstanceId, backingSpaceGuid);
cloudControllerFixture.stubCreateSpace(serviceInstanceId, backingSpaceGuid);
cloudControllerFixture.stubAssociatePermissions(serviceInstanceId, backingSpaceGuid);
cloudControllerFixture.stubAssociatePermissions();
cloudControllerFixture.stubPushAppWithHost(APP_NAME, APP_NAME + "-" + serviceInstanceId);

// given services are available in the marketplace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class DeleteInstanceComponentTest extends WiremockComponentTest {

@Test
void deleteAppsWhenTheyExist() {
cloudControllerFixture.stubAppExists(APP_NAME_1);
cloudControllerFixture.stubAppExists(APP_NAME_2);
cloudControllerFixture.stubAppExistsV3(APP_NAME_1);
cloudControllerFixture.stubAppExistsV3(APP_NAME_2);

cloudControllerFixture.stubServiceBindingDoesNotExist(APP_NAME_1);
cloudControllerFixture.stubServiceBindingDoesNotExist(APP_NAME_2);
Expand Down Expand Up @@ -90,6 +90,7 @@ void deleteAppsWhenTheyExist() {

@Test
void deleteAppsWhenTheyDoNotExist() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME_1);
cloudControllerFixture.stubAppDoesNotExist(APP_NAME_2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class DeleteInstanceWithAppsAndServicesComponentTest extends WiremockComponentTe

@Test
void deleteAppsAndServicesWhenTheyExist() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubFindSpace();
cloudControllerFixture.stubAppExistsWithBackingService(APP_NAME, BACKING_SI_NAME,
BACKING_SERVICE_NAME, BACKING_PLAN_NAME);
cloudControllerFixture.stubServiceBindingDoesNotExist(APP_NAME);
Expand Down Expand Up @@ -101,6 +103,7 @@ void deleteAppsAndServicesWhenTheyExist() {

@Test
void deleteAppsWhenTheyExistAndServicesWhenTheyDoNotExist() {
cloudControllerFixture.stubFindSpace();
cloudControllerFixture.stubAppExists(APP_NAME);
cloudControllerFixture.stubServiceBindingDoesNotExist(APP_NAME);
cloudControllerFixture.stubDeleteApp(APP_NAME);
Expand All @@ -126,6 +129,7 @@ void deleteAppsWhenTheyExistAndServicesWhenTheyDoNotExist() {

@Test
void deleteAppsAndServicesWhenTheyDoNotExist() {
cloudControllerFixture.stubFindSpace();
cloudControllerFixture.stubAppDoesNotExist(APP_NAME);

// when the service instance is deleted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void deleteServicesWhenTheyExist() {

@Test
void deleteServicesWhenTheyDoNotExist() {
cloudControllerFixture.stubFindSpaceV3();
// when the service instance is deleted
given(brokerFixture.serviceInstanceRequest())
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class UpdateInstanceComponentTest extends WiremockComponentTest {

@Test
void updateAppsWhenTheyExist() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppExists(APP_NAME_1);
cloudControllerFixture.stubUpdateApp(APP_NAME_1);
cloudControllerFixture.stubAppExists(APP_NAME_2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.springframework.http.HttpStatus;
import org.springframework.test.context.TestPropertySource;

import static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;
import static io.restassured.RestAssured.given;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.equalTo;
Expand Down Expand Up @@ -80,8 +79,10 @@ void updateAppWithNewServiceAndTarget() {
final String backingSpaceGuid = "instance-id-space-guid";
final String serviceInstanceId = "instance-id";

cloudControllerFixture.stubFindSpace(serviceInstanceId, backingSpaceGuid, STARTED);
cloudControllerFixture.stubSpaceExists(serviceInstanceId, backingSpaceGuid, STARTED);
cloudControllerFixture.stubFindTestOrg();
cloudControllerFixture.stubFindSpace(serviceInstanceId, backingSpaceGuid);
cloudControllerFixture.stubFindSpaceV3(serviceInstanceId, backingSpaceGuid);
cloudControllerFixture.stubSpaceExists(serviceInstanceId, backingSpaceGuid);
cloudControllerFixture.stubAppExistsWithBackingService(APP_NAME, BACKING_SI_NAME,
BACKING_SERVICE_NAME, BACKING_PLAN_NAME, backingSpaceGuid);
cloudControllerFixture.stubUpdateAppWithTarget(APP_NAME, backingSpaceGuid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class UpdateInstanceWithNewServiceComponentTest extends WiremockComponentTest {

@Test
void updateAppWithNewService() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppExistsWithBackingService(APP_NAME, BACKING_SI_NAME,
BACKING_SERVICE_NAME, BACKING_PLAN_NAME);
cloudControllerFixture.stubUpdateApp(APP_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class UpdateInstanceWithServicesComponentTest extends WiremockComponentTest {

@Test
void updateAppWithServices() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppExistsWithBackingService(APP_NAME, BACKING_SERVICE_INSTANCE_NAME,
BACKING_SERVICE_NAME, BACKING_PLAN_NAME);
cloudControllerFixture.stubUpdateApp(APP_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class UpdateInstanceWithServicesHostAndDomainComponentTest extends WiremockCompo

@Test
void updateAppWithHostAndDomain() {
cloudControllerFixture.stubFindTestOrg();
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppExists(APP_NAME);
cloudControllerFixture.stubUpdateAppWithHostAndDomain(APP_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class UpdateInstanceWithServicesParametersComponentTest extends WiremockComponen

@Test
void updateAppWithBackingServicesParameters() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppExistsWithBackingService(APP_NAME, BACKING_SI_NAME, BACKING_SERVICE_NAME,
BACKING_PLAN_NAME);
cloudControllerFixture.stubUpdateApp(APP_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class UpdateInstanceWithServicesRebindComponentTest extends WiremockComponentTes

@Test
void updateAppWithServices() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppExistsWithBackingService(APP_NAME, BACKING_SI_NAME, BACKING_SERVICE_NAME,
BACKING_PLAN_NAME);
cloudControllerFixture.stubUpdateApp(APP_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class UpdateInstanceWithUpgradeComponentTest extends WiremockComponentTest {

@Test
void updateAppsWhenTheyExist() {
cloudControllerFixture.stubFindSpaceV3();
cloudControllerFixture.stubAppExists(APP_NAME_1);
cloudControllerFixture.stubUpdateAppWithUpgrade(APP_NAME_1);

Expand Down
Loading