Skip to content

Commit

Permalink
Fix CI Failure
Browse files Browse the repository at this point in the history
A previous commit made an incorrect assumption about an expected return value in a test.
This commit makes the test less fragile.
  • Loading branch information
twoseat committed Apr 6, 2018
1 parent 60e8cd1 commit 87bd98d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import reactor.test.StepVerifier;

import java.time.Duration;
import java.util.function.Consumer;

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

public final class ServerInformationTest extends AbstractIntegrationTest {

Expand Down Expand Up @@ -81,11 +84,15 @@ public void getInfo() {
.build())
.map(response -> response.getLinks().getPassword())
.as(StepVerifier::create)
.expectNext("/forgot_password")
.consumeNextWith(endsWithExpectation("/forgot_password"))
.expectComplete()
.verify(Duration.ofMinutes(5));
}

private static Consumer<String> endsWithExpectation(String suffix) {
return actual -> assertThat(actual).endsWith(suffix);
}

private static Mono<String> getAuthenticationCode(UaaClient uaaClient, String clientId, String clientSecret, String password, String username) {
return requestAuthenticationCode(uaaClient, clientId, clientSecret, password, username)
.map(GetAutoLoginAuthenticationCodeResponse::getCode);
Expand Down

0 comments on commit 87bd98d

Please sign in to comment.