Adding await to wait longer for service deletion

This commit is contained in:
Alberto C. Ríos
2023-04-17 14:33:03 +02:00
parent 7892de1c2c
commit ae24d6ec84
3 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -33,6 +33,7 @@ import org.junit.jupiter.api.TestMethodOrder;
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 {
@@ -140,7 +141,7 @@ class UpdateInstanceWithNewServiceAcceptanceTest extends CloudFoundryAcceptanceT
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);

View File

@@ -33,6 +33,7 @@ import org.junit.jupiter.api.TestMethodOrder;
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 {
@@ -146,7 +147,7 @@ class UpdateInstanceWithNewServiceAndTargetAcceptanceTest extends CloudFoundryAc
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);