diff options
Diffstat (limited to 'container-core/src/test/java/com/yahoo/container/handler/LogHandlerTest.java')
-rw-r--r-- | container-core/src/test/java/com/yahoo/container/handler/LogHandlerTest.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/container-core/src/test/java/com/yahoo/container/handler/LogHandlerTest.java b/container-core/src/test/java/com/yahoo/container/handler/LogHandlerTest.java index 365b0313cf8..d578a745c9e 100644 --- a/container-core/src/test/java/com/yahoo/container/handler/LogHandlerTest.java +++ b/container-core/src/test/java/com/yahoo/container/handler/LogHandlerTest.java @@ -9,9 +9,10 @@ import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.time.Instant; import java.util.concurrent.Executor; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; public class LogHandlerTest { @@ -43,9 +44,13 @@ public class LogHandlerTest { } class MockLogReader extends LogReader { + MockLogReader() { + super("", ""); + } + @Override - protected JSONObject readLogs(String logDirectory, long earliestLogThreshold, long latestLogThreshold) throws JSONException { - if(latestLogThreshold > 1000) { + protected JSONObject readLogs(Instant earliestLogThreshold, Instant latestLogThreshold) throws JSONException { + if (latestLogThreshold.isAfter(Instant.ofEpochMilli(1000))) { return new JSONObject("{\"one\":\"newer_log\"}"); } else { return new JSONObject("{\"two\":\"older_log\"}"); |