diff options
author | ameya <ask1604@gmail.com> | 2017-10-11 13:03:03 -0700 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-10-16 09:34:31 +0200 |
commit | 3ab664433645b5e752c2447ce278617611aa9759 (patch) | |
tree | a7bcf5bcaa91c8ffbd9725dea124e010a964f54c /tests/src | |
parent | 18af892e0df11889eb699c4e562e6bbd979b559f (diff) | |
download | sonarqube-3ab664433645b5e752c2447ce278617611aa9759.tar.gz sonarqube-3ab664433645b5e752c2447ce278617611aa9759.zip |
Fix Quality flaws
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java b/tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java index 747602c0850..491c671a3ce 100644 --- a/tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java +++ b/tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java @@ -34,6 +34,7 @@ import java.util.List; import java.util.Random; import java.util.Set; import java.util.function.Function; +import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.IntStream; import javax.annotation.Nullable; @@ -209,16 +210,16 @@ public class CeWorkersTest { .getTasksList(); } - private <T> T waitForWsCallStatus(Function<WsClient, T> call, Function<T, Boolean> test) { + private <T> T waitForWsCallStatus(Function<WsClient, T> call, Predicate<T> test) { WsClient wsClient = ItUtils.newAdminWsClient(orchestrator); int i = 0; T returnValue = call.apply(wsClient); - boolean expectedState = test.apply(returnValue); + boolean expectedState = test.test(returnValue); while (i < MAX_WAIT_LOOP && !expectedState) { waitInterruptedly(); i++; returnValue = call.apply(wsClient); - expectedState = test.apply(returnValue); + expectedState = test.test(returnValue); } assertThat(expectedState) .as("Failed to wait for expected queue status. Last call returned:\n%s", returnValue) |