Skip to content

Commit 0ad9ec5

Browse files
committed
Adding await to wait longer for service deletion
1 parent 135e349 commit 0ad9ec5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

spring-cloud-app-broker-acceptance-tests/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ dependencies {
3131
testImplementation "io.projectreactor:reactor-test"
3232
testImplementation "org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}"
3333
testImplementation "org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}"
34+
testImplementation "org.awaitility:awaitility"
3435
}
3536

3637
// omit the version from the test broker jar file

spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAcceptanceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.springframework.beans.factory.annotation.Autowired;
3434

3535
import static org.assertj.core.api.Assertions.assertThat;
36+
import static org.awaitility.Awaitility.await;
3637

3738
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
3839
class UpdateInstanceWithNewServiceAcceptanceTest extends CloudFoundryAcceptanceTest {
@@ -140,7 +141,7 @@ void weUpdateTheServiceInstanceWithANewBackingService() {
140141
assertThat(newBackingServiceInstance.getApplications()).contains(APP_NAME);
141142

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

145146
// then the service instance is deleted
146147
deleteServiceInstance(SI_NAME);

spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAndTargetAcceptanceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.springframework.beans.factory.annotation.Autowired;
3434

3535
import static org.assertj.core.api.Assertions.assertThat;
36+
import static org.awaitility.Awaitility.await;
3637

3738
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
3839
class UpdateInstanceWithNewServiceAndTargetAcceptanceTest extends CloudFoundryAcceptanceTest {
@@ -146,7 +147,7 @@ void weUpdateTheServiceInstanceWithANewBackingService() {
146147
assertThat(newBackingServiceInstance.getApplications()).contains(APP_NAME);
147148

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

151152
// then the service instance is deleted
152153
deleteServiceInstance(SI_NAME);

0 commit comments

Comments
 (0)