From 588fc9e067f068d221621214e73ce5c47bd05757 Mon Sep 17 00:00:00 2001 From: Danish Nawab Date: Thu, 20 Sep 2018 11:04:14 +0200 Subject: [PATCH] add waitForImpersonator helper to be used in SITs --- gradle.properties | 2 +- .../helper/DockerComposeHelper.java | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 2688624..d5a60ba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=3.2.40 +version=3.2.41 diff --git a/src/main/java/com/sixt/service/framework/servicetest/helper/DockerComposeHelper.java b/src/main/java/com/sixt/service/framework/servicetest/helper/DockerComposeHelper.java index c4f97a4..9fb4ef9 100644 --- a/src/main/java/com/sixt/service/framework/servicetest/helper/DockerComposeHelper.java +++ b/src/main/java/com/sixt/service/framework/servicetest/helper/DockerComposeHelper.java @@ -135,6 +135,29 @@ public static SuccessOrFailure waitForPostgres(String logFile, String phraseToWa return waitFor(logFile, phraseToWaitFor, "Postgres not ready yet"); } + /** + * Wait for impersonator to become ready by checking log for + * "Jetty has started" + * + * @param logFile The logfile to check + * @return SuccessOrFailure + */ + public static SuccessOrFailure waitForImpersonator(String logFile) { + return waitForImpersonator(logFile, "Jetty has started"); + } + + /** + * Wait for impersonator to become ready by checking log for + * some custom expected phrase + * + * @param logFile The logfile to check + * @param phraseToWaitFor The phrase in logs we wait for + * @return SuccessOrFailure + */ + public static SuccessOrFailure waitForImpersonator(String logFile, String phraseToWaitFor) { + return waitFor(logFile, phraseToWaitFor, "Impersonator not ready yet"); + } + /** * Wait for Consul to become ready by checking log for "consul: New leader elected" *