@@ -113,7 +113,7 @@ public void setup() throws Exception {
113113 MODEL_TWO = (datawave .webservice .model .Model ) u .unmarshal (m2Url );
114114
115115 Logger .getLogger (ModelBean .class ).setLevel (Level .OFF );
116- PowerMock . mockStatic ( System . class , System . class . getMethod ( "currentTimeMillis" )) ;
116+ ModelKeyParser . clock = () -> TIMESTAMP ;
117117 }
118118
119119 public void printTable (String tableName ) throws Exception {
@@ -125,6 +125,7 @@ public void printTable(String tableName) throws Exception {
125125
126126 @ After
127127 public void tearDown () {
128+ ModelKeyParser .clock = System ::currentTimeMillis ;
128129 try {
129130 client .tableOperations ().delete (ModelBean .DEFAULT_MODEL_TABLE_NAME );
130131 } catch (Exception e ) {}
@@ -156,10 +157,7 @@ private void importModels() throws Exception {
156157 EasyMock .expect (connectionFactory .getTrackingMap ((StackTraceElement []) EasyMock .anyObject ())).andReturn (trackingMap );
157158 EasyMock .expect (connectionFactory .getClient (EasyMock .eq (userDN .toLowerCase ()), EasyMock .eq (null ), EasyMock .eq (AccumuloConnectionFactory .Priority .LOW ),
158159 EasyMock .eq (trackingMap ))).andReturn (client );
159- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
160160 connectionFactory .returnClient (client );
161- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
162- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
163161 cache .reloadTableCache (ModelBean .DEFAULT_MODEL_TABLE_NAME );
164162 PowerMock .replayAll ();
165163
@@ -175,11 +173,7 @@ private void importModels() throws Exception {
175173 EasyMock .expect (connectionFactory .getTrackingMap ((StackTraceElement []) EasyMock .anyObject ())).andReturn (trackingMap );
176174 EasyMock .expect (connectionFactory .getClient (EasyMock .eq (userDN .toLowerCase ()), EasyMock .eq (null ), EasyMock .eq (AccumuloConnectionFactory .Priority .LOW ),
177175 EasyMock .eq (trackingMap ))).andReturn (client );
178- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
179176 connectionFactory .returnClient (client );
180- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
181- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
182- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
183177 cache .reloadTableCache (ModelBean .DEFAULT_MODEL_TABLE_NAME );
184178 PowerMock .replayAll ();
185179
@@ -246,14 +240,8 @@ public void testModelDelete() throws Exception {
246240 EasyMock .expect (connectionFactory .getTrackingMap ((StackTraceElement []) EasyMock .anyObject ())).andReturn (trackingMap );
247241 EasyMock .expect (connectionFactory .getClient (EasyMock .eq (userDN .toLowerCase ()), EasyMock .eq (null ), EasyMock .eq (AccumuloConnectionFactory .Priority .LOW ),
248242 EasyMock .eq (trackingMap ))).andReturn (client );
249- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
250- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
251- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
252243 connectionFactory .returnClient (client );
253244 cache .reloadTableCache (ModelBean .DEFAULT_MODEL_TABLE_NAME );
254- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
255- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
256- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
257245 PowerMock .replayAll ();
258246
259247 bean .deleteModel (MODEL_TWO .getName (), (String ) null );
@@ -326,10 +314,7 @@ public void testCloneModel() throws Exception {
326314 EasyMock .expect (connectionFactory .getClient (EasyMock .eq (userDN .toLowerCase ()), EasyMock .eq (null ), EasyMock .eq (AccumuloConnectionFactory .Priority .LOW ),
327315 EasyMock .eq (trackingMap ))).andReturn (client );
328316 cache .reloadTableCache (ModelBean .DEFAULT_MODEL_TABLE_NAME );
329- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
330317 connectionFactory .returnClient (client );
331- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
332- EasyMock .expect (System .currentTimeMillis ()).andReturn (TIMESTAMP );
333318 PowerMock .replayAll ();
334319
335320 bean .cloneModel (MODEL_ONE .getName (), "MODEL2" , (String ) null );
0 commit comments