Skip to content

Commit

Permalink
Use java.time and not joda time
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Mar 5, 2024
1 parent 6216858 commit 19156ec
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/test/java/org/opensearch/flowframework/model/TemplateTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
*/
package org.opensearch.flowframework.model;

import org.opensearch.Version;
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;

import org.opensearch.Version;
import org.opensearch.core.rest.RestStatus;
import org.opensearch.flowframework.exception.FlowFrameworkException;
import org.opensearch.test.OpenSearchTestCase;

public class TemplateTests extends OpenSearchTestCase {

private String expectedTemplate =
Expand Down Expand Up @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit 19156ec

Please sign in to comment.