Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Jenya Mia
Added: Jan 2, 2020 8:24 PM
Modified: Jan 7, 2020 7:29 PM
Views: 8
Tags: mockito
  1.         Mockito.when(executorService.submit(Mockito.any(NamedRunnable.class))).thenAnswer((Answer<Object>) invocationOnMock -> {
  2.             NamedRunnable namedRunnable = invocationOnMock.getArgument(0, NamedRunnable.class);
  3.             namedRunnable.run();
  4.             assertEquals(taskName, namedRunnable.getTaskName());
  5.             succeed = namedRunnable.isSuccessful();
  6.             assertTrue(namedRunnable.isSystemGenerated());
  7.             return null;
  8.         });