Skip to content

Commit

Permalink
Adding await to wait longer for service deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Albertoimpl committed Apr 18, 2023
1 parent 63dedf6 commit c0503d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions spring-cloud-app-broker-acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
testImplementation "io.projectreactor:reactor-test"
testImplementation "org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}"
testImplementation "org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}"
testImplementation "org.awaitility:awaitility"
}

// omit the version from the test broker jar file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.springframework.beans.factory.annotation.Autowired;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class UpdateInstanceWithNewServiceAcceptanceTest extends CloudFoundryAcceptanceTest {
Expand Down Expand Up @@ -140,7 +141,7 @@ void weUpdateTheServiceInstanceWithANewBackingService() {
assertThat(newBackingServiceInstance.getApplications()).contains(APP_NAME);

// and the old backing service is deleted
assertThat(listServiceInstances()).doesNotContain(OLD_BACKING_SI_NAME);
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(OLD_BACKING_SI_NAME));

// then the service instance is deleted
deleteServiceInstance(SI_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.springframework.beans.factory.annotation.Autowired;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class UpdateInstanceWithNewServiceAndTargetAcceptanceTest extends CloudFoundryAcceptanceTest {
Expand Down Expand Up @@ -146,7 +147,7 @@ void weUpdateTheServiceInstanceWithANewBackingService() {
assertThat(newBackingServiceInstance.getApplications()).contains(APP_NAME);

// and the old backing service is deleted
assertThat(listServiceInstances()).doesNotContain(OLD_BACKING_SI_NAME);
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(OLD_BACKING_SI_NAME));

// then the service instance is deleted
deleteServiceInstance(SI_NAME);
Expand Down

0 comments on commit c0503d6

Please sign in to comment.