File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/test/java/com/iexec/core/worker Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -305,6 +305,28 @@ public void shouldGetEmptyChainTaskIdListSinceWorkerNotFound() {
305305 when (workerRepository .findByWalletAddress (wallet )).thenReturn (Optional .empty ());
306306 assertThat (workerService .getChainTaskIds (wallet )).isEmpty ();
307307 }
308+
309+ // Computing task IDs
310+
311+ @ Test
312+ public void shouldGetComputingTaskIds () {
313+ String wallet = "wallet" ;
314+ List <String > list = List .of ("t1" , "t1" );
315+ Worker worker = Worker .builder ()
316+ .computingChainTaskIds (list )
317+ .build ();
318+ when (workerRepository .findByWalletAddress (wallet )).thenReturn (Optional .of (worker ));
319+
320+ assertThat (workerService .getComputingTaskIds (wallet )).isEqualTo (list );
321+ }
322+
323+ @ Test
324+ public void shouldNotGetComputingTaskIdsSinceNoWorker () {
325+ String wallet = "wallet" ;
326+ when (workerRepository .findByWalletAddress (wallet )).thenReturn (Optional .empty ());
327+
328+ assertThat (workerService .getComputingTaskIds (wallet )).isEmpty ();
329+ }
308330
309331 // removeChainTaskIdFromWorker
310332
You can’t perform that action at this time.
0 commit comments