Skip to content

Commit afe30ef

Browse files
committed
Adding await to wait longer for service deletion
1 parent 8ec6705 commit afe30ef

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
@@ -29,6 +29,7 @@ dependencies {
2929
testImplementation "io.projectreactor:reactor-test"
3030
testImplementation "org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}"
3131
testImplementation "org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}"
32+
testImplementation "org.awaitility:awaitility"
3233
}
3334

3435
// 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)