From 2ac5dd2ab5119aca56b920c1e65ed3cad6311f86 Mon Sep 17 00:00:00 2001 From: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:59:47 +0100 Subject: [PATCH] Implement sleepMillis in MockTimeService to fix main build failures Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> --- .../java/dev/galasa/extensions/mocks/MockTimeService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/galasa-extensions-parent/dev.galasa.extensions.mocks/src/main/java/dev/galasa/extensions/mocks/MockTimeService.java b/galasa-extensions-parent/dev.galasa.extensions.mocks/src/main/java/dev/galasa/extensions/mocks/MockTimeService.java index eadad615..2171709f 100644 --- a/galasa-extensions-parent/dev.galasa.extensions.mocks/src/main/java/dev/galasa/extensions/mocks/MockTimeService.java +++ b/galasa-extensions-parent/dev.galasa.extensions.mocks/src/main/java/dev/galasa/extensions/mocks/MockTimeService.java @@ -25,4 +25,10 @@ public Instant now() { public void setCurrentTime(Instant currentTime) { this.currentTime = currentTime; } + + @Override + public void sleepMillis(long millisToSleep) throws InterruptedException { + // Pretend we are sleeping, so the current time advances. + setCurrentTime(currentTime.plusMillis(millisToSleep)); + } }