test_class.declarator: task
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private StepListPreparationsMigration task;
test_class.type: StepListPreparationsMigration
test_class.var_name: task
test_class.declarator: preparationRepository
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private PreparationRepository preparationRepository;
test_class.type: PreparationRepository
test_class.var_name: preparationRepository
test_class.file: dataprep-upgrade/src/test/java/org/talend/dataprep/upgrade/to_2_1_0_PE/StepListPreparationsMigrationTest.java
test_class.identifier: StepListPreparationsMigrationTest
test_class.superclass: extends Base_2_1_0_PE_Test
test_case.body: @Test
      public void shouldUpdateStepMetadata() {
          // when
          task.run();
  
          // then
          List<PersistentPreparation> preparationList = preparationRepository
                  .list(PersistentPreparation.class)
                  .sorted(Comparator.comparingInt(o -> o.getSteps().size()))
                  .collect(Collectors.toList());
  
          assertEquals(4, preparationList.get(0).getSteps().size());
          assertEquals(8, preparationList.get(1).getSteps().size());
      }
test_case.class_method_signature: StepListPreparationsMigrationTest.shouldUpdateStepMetadata()
test_case.full_signature: @Test public void shouldUpdateStepMetadata()
test_case.identifier: shouldUpdateStepMetadata
test_case.invocations: run collect sorted list comparingInt size getSteps toList assertEquals size getSteps get assertEquals size getSteps get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldUpdateStepMetadata()
focal_class.declarator: LOGGER = getLogger(StepRowMetadataMigration.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = getLogger(StepRowMetadataMigration.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: preparationRepository
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private PreparationRepository preparationRepository;
focal_class.type: PreparationRepository
focal_class.var_name: preparationRepository
focal_class.declarator: preparationUtils
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private PreparationUtils preparationUtils;
focal_class.type: PreparationUtils
focal_class.var_name: preparationUtils
focal_class.file: dataprep-upgrade/src/main/java/org/talend/dataprep/upgrade/to_2_1_0_PE/StepListPreparationsMigration.java
focal_class.identifier: StepListPreparationsMigration
focal_class.interfaces: implements BaseUpgradeTaskTo_2_1_0_PE
focal_class.class_method_signature: StepListPreparationsMigration.run()
focal_class.full_signature: @Override public void run()
focal_class.identifier: run
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void run()
focal_class.class_method_signature: StepListPreparationsMigration.getOrder()
focal_class.full_signature: @Override public int getOrder()
focal_class.identifier: getOrder
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getOrder()
focal_class.class_method_signature: StepListPreparationsMigration.getTarget()
focal_class.full_signature: @Override public UpgradeTask.target getTarget()
focal_class.identifier: getTarget
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: UpgradeTask.target
focal_class.signature: UpgradeTask.target getTarget()
focal_method.body: @Override
      public void run() {
          LOGGER.info("Migration of step ids in preparation...");
  
          preparationRepository
                  .list(PersistentPreparation.class) //
                  .forEach(p -> {
                      LOGGER.info("Migration of preparation #{}", p.getId());
                      final List<String> stepsIds = preparationUtils.listStepsIds(p.getHeadId(), preparationRepository);
                      p.setSteps(stepsIds);
  
                      preparationRepository.add(p);
                      LOGGER.info("Migration of preparation #{} done ({} steps)", p.getId(), stepsIds.size());
                  });
          LOGGER.info("Migration of step ids in preparation done.");
      }
focal_method.class_method_signature: StepListPreparationsMigration.run()
focal_method.full_signature: @Override public void run()
focal_method.identifier: run
focal_method.invocations: info forEach list info getId listStepsIds getHeadId setSteps add info getId size info
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void run()