test_class.declarator: upgradeTask
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private UpgradeTask upgradeTask;
test_class.type: UpgradeTask
test_class.var_name: upgradeTask
test_class.declarator: security
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Security security;
test_class.type: Security
test_class.var_name: security
test_class.declarator: executor
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private TaskExecutor executor;
test_class.type: TaskExecutor
test_class.var_name: executor
test_class.declarator: forAll
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ForAll forAll;
test_class.type: ForAll
test_class.var_name: forAll
test_class.declarator: upgradeService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UpgradeService upgradeService;
test_class.type: UpgradeService
test_class.var_name: upgradeService
test_class.file: dataprep-maintenance/src/test/java/org/talend/dataprep/maintenance/upgrade/UpgradeTaskTest.java
test_class.identifier: UpgradeTaskTest
test_case.body: @Test
      public void shouldPerformUpgrade() {
          // given
          when(upgradeService.needUpgrade()).thenReturn(true);
          when(forAll.condition()).thenReturn(o -> () -> true);
  
          doAnswer((Answer<Void>) invocation -> {
              ((Runnable) invocation.getArguments()[1]).run();
              return null;
          }).when(forAll).execute(any(), any());
  
          doAnswer((Answer<Void>) invocation -> {
              ((Runnable) invocation.getArguments()[0]).run();
              return null;
          }).when(executor).execute(any());
  
          // when
          upgradeTask.execute();
  
          // then
          verify(security, times(2)).getTenantId();
          verify(upgradeService, times(1)).upgradeVersion();
      }
test_case.class_method_signature: UpgradeTaskTest.shouldPerformUpgrade()
test_case.full_signature: @Test public void shouldPerformUpgrade()
test_case.identifier: shouldPerformUpgrade
test_case.invocations: thenReturn when needUpgrade thenReturn when condition execute when doAnswer run getArguments any any execute when doAnswer run getArguments any execute getTenantId verify times upgradeVersion verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldPerformUpgrade()
focal_class.declarator: LOG = getLogger(UpgradeTask.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = getLogger(UpgradeTask.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: upgradeService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private UpgradeService upgradeService;
focal_class.type: UpgradeService
focal_class.var_name: upgradeService
focal_class.declarator: repository
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private UpgradeTaskRepository repository;
focal_class.type: UpgradeTaskRepository
focal_class.var_name: repository
focal_class.declarator: forAll
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ForAll forAll;
focal_class.type: ForAll
focal_class.var_name: forAll
focal_class.declarator: security
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private Security security;
focal_class.type: Security
focal_class.var_name: security
focal_class.file: dataprep-maintenance/src/main/java/org/talend/dataprep/maintenance/upgrade/UpgradeTask.java
focal_class.identifier: UpgradeTask
focal_class.interfaces: implements MaintenanceTaskProcess
focal_class.class_method_signature: UpgradeTask.performTask()
focal_class.full_signature: public void performTask()
focal_class.identifier: performTask
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void performTask()
focal_class.class_method_signature: UpgradeTask.condition()
focal_class.full_signature: public Supplier<Boolean> condition()
focal_class.identifier: condition
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Supplier<Boolean>
focal_class.signature: Supplier<Boolean> condition()
focal_class.class_method_signature: UpgradeTask.getFrequency()
focal_class.full_signature: @Override public ScheduleFrequency getFrequency()
focal_class.identifier: getFrequency
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ScheduleFrequency
focal_class.signature: ScheduleFrequency getFrequency()
focal_method.body: public Supplier<Boolean> condition() {
          final Supplier<Boolean> needUpgradeCondition = () -> upgradeService.needUpgrade();
          final Supplier<Boolean> hasRepositoryConfiguration = forAll.condition().operational(repository);
          return () -> needUpgradeCondition.get() && hasRepositoryConfiguration.get();
      }
focal_method.class_method_signature: UpgradeTask.condition()
focal_method.full_signature: public Supplier<Boolean> condition()
focal_method.identifier: condition
focal_method.invocations: needUpgrade operational condition get get
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Supplier<Boolean>
focal_method.signature: Supplier<Boolean> condition()