From a5c2bfae9ad9f6a57d9db5ad0bf1b1bfd5f3cc27 Mon Sep 17 00:00:00 2001 From: Lukas Krecan Date: Fri, 21 Jan 2022 19:42:09 +0100 Subject: [PATCH] Test fixed --- .../net/javacrumbs/shedlock/test/boot/ScheduledTasks.java | 4 ++++ .../net/javacrumbs/shedlock/test/boot/ScheduledTasks.java | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring/test/shedlock-springboot-future-test/src/main/java/net/javacrumbs/shedlock/test/boot/ScheduledTasks.java b/spring/test/shedlock-springboot-future-test/src/main/java/net/javacrumbs/shedlock/test/boot/ScheduledTasks.java index 71f0437d4..c4d3b5498 100644 --- a/spring/test/shedlock-springboot-future-test/src/main/java/net/javacrumbs/shedlock/test/boot/ScheduledTasks.java +++ b/spring/test/shedlock-springboot-future-test/src/main/java/net/javacrumbs/shedlock/test/boot/ScheduledTasks.java @@ -19,9 +19,12 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.time.Duration; import java.util.Date; +import static java.time.Duration.ZERO; import static net.javacrumbs.shedlock.core.LockAssert.assertLocked; +import static net.javacrumbs.shedlock.core.LockExtender.extendActiveLock; @Component public class ScheduledTasks { @@ -29,6 +32,7 @@ public class ScheduledTasks { @SchedulerLock(name = "reportCurrentTime", lockAtMostFor = "${lock.at.most.for}") public void reportCurrentTime() { assertLocked(); + extendActiveLock(Duration.ofMillis(5), ZERO); System.out.println(new Date()); } } diff --git a/spring/test/shedlock-springboot-test/src/main/java/net/javacrumbs/shedlock/test/boot/ScheduledTasks.java b/spring/test/shedlock-springboot-test/src/main/java/net/javacrumbs/shedlock/test/boot/ScheduledTasks.java index c4d3b5498..71f0437d4 100644 --- a/spring/test/shedlock-springboot-test/src/main/java/net/javacrumbs/shedlock/test/boot/ScheduledTasks.java +++ b/spring/test/shedlock-springboot-test/src/main/java/net/javacrumbs/shedlock/test/boot/ScheduledTasks.java @@ -19,12 +19,9 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import java.time.Duration; import java.util.Date; -import static java.time.Duration.ZERO; import static net.javacrumbs.shedlock.core.LockAssert.assertLocked; -import static net.javacrumbs.shedlock.core.LockExtender.extendActiveLock; @Component public class ScheduledTasks { @@ -32,7 +29,6 @@ public class ScheduledTasks { @SchedulerLock(name = "reportCurrentTime", lockAtMostFor = "${lock.at.most.for}") public void reportCurrentTime() { assertLocked(); - extendActiveLock(Duration.ofMillis(5), ZERO); System.out.println(new Date()); } }