Skip to content

Commit 0fcd650

Browse files
committed
Merge branch '2.x'
2 parents f1b0826 + 2f788a3 commit 0fcd650

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

integration-test/src/test/java/org/cloudfoundry/CloudFoundryCleaner.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,12 @@ void clean() {
162162
cleanServiceBrokers(this.cloudFoundryClient, this.nameFactory),
163163
cleanSpaceQuotaDefinitions(this.cloudFoundryClient, this.nameFactory),
164164
cleanStacks(this.cloudFoundryClient, this.nameFactory),
165-
cleanUsers(this.cloudFoundryClient, this.nameFactory),
166-
cleanUsers(this.uaaClient, this.nameFactory)
165+
cleanUsers(this.cloudFoundryClient, this.nameFactory)
166+
))
167+
.thenMany(Mono.when(
168+
cleanApplicationsV2(this.cloudFoundryClient, this.nameFactory), // After Routes, cannot run with other cleanApps
169+
cleanUsers(this.uaaClient, this.nameFactory) // After CF Users
167170
))
168-
.thenMany(cleanApplicationsV2(this.cloudFoundryClient, this.nameFactory)) // After Routes, cannot run with other cleanApps
169171
.thenMany(Mono.when( // After Routes/Applications
170172
cleanPrivateDomains(this.cloudFoundryClient, this.nameFactory),
171173
cleanSharedDomains(this.cloudFoundryClient, this.nameFactory),
@@ -546,8 +548,8 @@ private static Flux<Void> cleanUsers(CloudFoundryClient cloudFoundryClient, Name
546548
.async(true)
547549
.userId(userId)
548550
.build())
549-
.doOnError(t -> LOGGER.error("Unable to delete user {}", userId, t)))
550-
.flatMap(job -> JobUtils.waitForCompletion(cloudFoundryClient, Duration.ofMinutes(5), job));
551+
.flatMapMany(job -> JobUtils.waitForCompletion(cloudFoundryClient, Duration.ofMinutes(5), job))
552+
.doOnError(t -> LOGGER.error("Unable to delete user {}", userId, t)));
551553
}
552554

553555
private static Flux<Void> cleanUsers(UaaClient uaaClient, NameFactory nameFactory) {
@@ -593,7 +595,7 @@ private static Flux<Void> ifCfVersion(CloudFoundryVersion expectedVersion, Versi
593595
}
594596

595597
private static boolean isCleanable(NameFactory nameFactory, UserResource resource) {
596-
return nameFactory.isUserId(ResourceUtils.getId(resource)) || nameFactory.isUserId(ResourceUtils.getEntity(resource).getUsername());
598+
return nameFactory.isUserId(ResourceUtils.getId(resource)) || nameFactory.isUserName(ResourceUtils.getEntity(resource).getUsername());
597599
}
598600

599601
private static Flux<Void> removeApplicationServiceBindings(CloudFoundryClient cloudFoundryClient, ApplicationResource application) {

integration-test/src/test/java/org/cloudfoundry/uaa/UsersTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import reactor.test.StepVerifier;
5151

5252
import java.time.Duration;
53-
import java.util.concurrent.TimeoutException;
5453

5554
import static org.assertj.core.api.Assertions.assertThat;
5655

0 commit comments

Comments
 (0)