diff --git a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/CreateInstanceWithServiceInstanceGuidSuffixTargetAcceptanceTest.java b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/CreateInstanceWithServiceInstanceGuidSuffixTargetAcceptanceTest.java index 85c20ff4..e79fe101 100644 --- a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/CreateInstanceWithServiceInstanceGuidSuffixTargetAcceptanceTest.java +++ b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/CreateInstanceWithServiceInstanceGuidSuffixTargetAcceptanceTest.java @@ -23,6 +23,7 @@ import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; class CreateInstanceWithServiceInstanceGuidSuffixTargetAcceptanceTest extends CloudFoundryAcceptanceTest { @@ -90,7 +91,7 @@ void deployAppsWithServiceInstanceGuidSuffixOnCreateService() { deleteServiceInstance(SI_NAME); // and the backing service is deleted - assertThat(listServiceInstances()).doesNotContain(expectedServiceInstanceName); + await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(expectedServiceInstanceName)); } } diff --git a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/CreateInstanceWithServicesAcceptanceTest.java b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/CreateInstanceWithServicesAcceptanceTest.java index 13710140..83132571 100644 --- a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/CreateInstanceWithServicesAcceptanceTest.java +++ b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/CreateInstanceWithServicesAcceptanceTest.java @@ -24,6 +24,7 @@ import static java.util.Collections.emptyMap; import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; class CreateInstanceWithServicesAcceptanceTest extends CloudFoundryAcceptanceTest { @@ -91,8 +92,8 @@ void deployAppsAndCreateServicesOnCreateService() { deleteServiceInstance(SI_NAME); // and the backing services are deleted - assertThat(listServiceInstances()).doesNotContain(BACKING_SI_1_NAME); - assertThat(listServiceInstances()).doesNotContain(BACKING_SI_2_NAME); + await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(BACKING_SI_1_NAME)); + await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(BACKING_SI_2_NAME)); // TODO: another story to only remove the instances with service definition specified (https://github.com/spring-cloud/spring-cloud-app-broker/issues/316) // // service without specification has no applications bound to it diff --git a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAcceptanceTest.java b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAcceptanceTest.java index d65ff104..9f6ee6dc 100644 --- a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAcceptanceTest.java +++ b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAcceptanceTest.java @@ -147,7 +147,8 @@ void weUpdateTheServiceInstanceWithANewBackingService() { deleteServiceInstance(SI_NAME); // and the backing service is deleted - assertThat(listServiceInstances()).doesNotContain(NEW_BACKING_SI_NAME); + await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(NEW_BACKING_SI_NAME)); + } @Override diff --git a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAndTargetAcceptanceTest.java b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAndTargetAcceptanceTest.java index 25473ed4..09881cbf 100644 --- a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAndTargetAcceptanceTest.java +++ b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithNewServiceAndTargetAcceptanceTest.java @@ -153,7 +153,7 @@ void weUpdateTheServiceInstanceWithANewBackingService() { deleteServiceInstance(SI_NAME); // and the backing service is deleted - assertThat(listServiceInstances()).doesNotContain(NEW_BACKING_SI_NAME); + await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(NEW_BACKING_SI_NAME)); } @Override diff --git a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithServicesAcceptanceTest.java b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithServicesAcceptanceTest.java index 6d6a8927..6cb43192 100644 --- a/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithServicesAcceptanceTest.java +++ b/spring-cloud-app-broker-acceptance-tests/src/test/java/org/springframework/cloud/appbroker/acceptance/UpdateInstanceWithServicesAcceptanceTest.java @@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired; import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; class UpdateInstanceWithServicesAcceptanceTest extends CloudFoundryAcceptanceTest { @@ -115,7 +116,7 @@ void shouldPushAppWithServicesBind() { deleteServiceInstance(SI_NAME); // and the backing service is deleted - assertThat(listServiceInstances()).doesNotContain(BACKING_SI_NAME); + await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(BACKING_SI_NAME)); } }