From 9d1089df8b1eb71c62ea87eb473d8ea74bbf314d Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Mon, 4 Mar 2024 23:27:08 -0800 Subject: [PATCH] Use java.time and not joda time Signed-off-by: Daniel Widdis --- .../opensearch/flowframework/model/TemplateTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/opensearch/flowframework/model/TemplateTests.java b/src/test/java/org/opensearch/flowframework/model/TemplateTests.java index 95e9aaa9a..229948ae3 100644 --- a/src/test/java/org/opensearch/flowframework/model/TemplateTests.java +++ b/src/test/java/org/opensearch/flowframework/model/TemplateTests.java @@ -12,9 +12,9 @@ import org.opensearch.core.rest.RestStatus; import org.opensearch.flowframework.exception.FlowFrameworkException; import org.opensearch.test.OpenSearchTestCase; -import org.joda.time.Instant; import java.io.IOException; +import java.time.Instant; import java.util.Collections; import java.util.List; import java.util.Map; @@ -63,8 +63,8 @@ public void testTemplate() throws IOException { assertEquals(uiMetadata, template.getUiMetadata()); Workflow wf = template.workflows().get("workflow"); assertNotNull(wf); - assertTrue(template.createdTime() > Instant.now().minus(10_000).getMillis()); - assertTrue(template.createdTime() < Instant.now().getMillis()); + assertTrue(template.createdTime() > Instant.now().minusSeconds(10).toEpochMilli()); + assertTrue(template.createdTime() < Instant.now().toEpochMilli()); assertEquals(template.createdTime(), template.lastUpdatedTime()); assertEquals(-1, template.lastProvisionedTime()); assertEquals("Workflow [userParams={key=value}, nodes=[A, B], edges=[A->B]]", wf.toString()); @@ -80,8 +80,8 @@ public void testTemplate() throws IOException { assertEquals(uiMetadata, templateX.getUiMetadata()); Workflow wfX = templateX.workflows().get("workflow"); assertNotNull(wfX); - assertTrue(template.createdTime() > Instant.now().minus(10_000).getMillis()); - assertTrue(template.createdTime() < Instant.now().getMillis()); + assertTrue(template.createdTime() > Instant.now().minusSeconds(10).toEpochMilli()); + assertTrue(template.createdTime() < Instant.now().toEpochMilli()); assertEquals(template.lastUpdatedTime(), template.createdTime()); assertEquals(-1, template.lastProvisionedTime()); assertEquals("Workflow [userParams={key=value}, nodes=[A, B], edges=[A->B]]", wfX.toString());