8
8
*/
9
9
package org .opensearch .flowframework .model ;
10
10
11
- import org .opensearch .Version ;
12
- import org .opensearch .core .rest .RestStatus ;
13
- import org .opensearch .flowframework .exception .FlowFrameworkException ;
14
- import org .opensearch .test .OpenSearchTestCase ;
15
- import org .joda .time .Instant ;
16
-
17
11
import java .io .IOException ;
12
+ import java .time .Instant ;
18
13
import java .util .Collections ;
19
14
import java .util .List ;
20
15
import java .util .Map ;
21
16
17
+ import org .opensearch .Version ;
18
+ import org .opensearch .core .rest .RestStatus ;
19
+ import org .opensearch .flowframework .exception .FlowFrameworkException ;
20
+ import org .opensearch .test .OpenSearchTestCase ;
21
+
22
22
public class TemplateTests extends OpenSearchTestCase {
23
23
24
24
private String expectedTemplate =
@@ -63,8 +63,8 @@ public void testTemplate() throws IOException {
63
63
assertEquals (uiMetadata , template .getUiMetadata ());
64
64
Workflow wf = template .workflows ().get ("workflow" );
65
65
assertNotNull (wf );
66
- assertTrue (template .createdTime () > Instant .now ().minus ( 10_000 ). getMillis ());
67
- assertTrue (template .createdTime () < Instant .now ().getMillis ());
66
+ assertTrue (template .createdTime () > Instant .now ().minusSeconds ( 10 ). toEpochMilli ());
67
+ assertTrue (template .createdTime () <= Instant .now ().toEpochMilli ());
68
68
assertEquals (template .createdTime (), template .lastUpdatedTime ());
69
69
assertEquals (-1 , template .lastProvisionedTime ());
70
70
assertEquals ("Workflow [userParams={key=value}, nodes=[A, B], edges=[A->B]]" , wf .toString ());
@@ -80,8 +80,8 @@ public void testTemplate() throws IOException {
80
80
assertEquals (uiMetadata , templateX .getUiMetadata ());
81
81
Workflow wfX = templateX .workflows ().get ("workflow" );
82
82
assertNotNull (wfX );
83
- assertTrue (template .createdTime () > Instant .now ().minus ( 10_000 ). getMillis ());
84
- assertTrue (template .createdTime () < Instant .now ().getMillis ());
83
+ assertTrue (template .createdTime () > Instant .now ().minusSeconds ( 10 ). toEpochMilli ());
84
+ assertTrue (template .createdTime () <= Instant .now ().toEpochMilli ());
85
85
assertEquals (template .lastUpdatedTime (), template .createdTime ());
86
86
assertEquals (-1 , template .lastProvisionedTime ());
87
87
assertEquals ("Workflow [userParams={key=value}, nodes=[A, B], edges=[A->B]]" , wfX .toString ());
0 commit comments