test_class.declarator: updater
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private PreparationDatasetRowUpdater updater;
test_class.type: PreparationDatasetRowUpdater
test_class.var_name: updater
test_class.declarator: preparationRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private PreparationRepository preparationRepository;
test_class.type: PreparationRepository
test_class.var_name: preparationRepository
test_class.declarator: dataSetMetadataRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private DataSetMetadataRepository dataSetMetadataRepository;
test_class.type: DataSetMetadataRepository
test_class.var_name: dataSetMetadataRepository
test_class.file: dataprep-upgrade-common/src/test/java/org/talend/dataprep/upgrade/common/PreparationDatasetRowUpdaterTest.java
test_class.identifier: PreparationDatasetRowUpdaterTest
test_case.body: @Test
      public void updatePreparations() throws Exception {
          // given
          String datasetId = "dataset id";
          Preparation prep = new Preparation("prepId", "123456");
          prep.setDataSetId(datasetId);
          final List<Preparation> preparations = singletonList(prep);
          when(preparationRepository.list(Preparation.class)).thenReturn(preparations.stream());
  
          DataSetMetadata datasetMetadata = new DataSetMetadata();
          datasetMetadata.setRowMetadata(new RowMetadata());
          when(dataSetMetadataRepository.get(datasetId)).thenReturn(datasetMetadata);
  
          // when
          updater.updatePreparations();
  
          // then
          verify(preparationRepository, times(1)).list(Preparation.class);
          verify(preparationRepository, times(1)).add(prep);
          verify(dataSetMetadataRepository, only()).get(datasetId);
      }
test_case.class_method_signature: PreparationDatasetRowUpdaterTest.updatePreparations()
test_case.full_signature: @Test public void updatePreparations()
test_case.identifier: updatePreparations
test_case.invocations: setDataSetId singletonList thenReturn when list stream setRowMetadata thenReturn when get updatePreparations list verify times add verify times get verify only
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void updatePreparations()
focal_class.declarator: LOGGER = getLogger(PreparationDatasetRowUpdater.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = getLogger(PreparationDatasetRowUpdater.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: dataSetMetadataRepository
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private DataSetMetadataRepository dataSetMetadataRepository;
focal_class.type: DataSetMetadataRepository
focal_class.var_name: dataSetMetadataRepository
focal_class.file: dataprep-upgrade-common/src/main/java/org/talend/dataprep/upgrade/common/PreparationDatasetRowUpdater.java
focal_class.identifier: PreparationDatasetRowUpdater
focal_class.class_method_signature: PreparationDatasetRowUpdater.updatePreparations()
focal_class.full_signature: public void updatePreparations()
focal_class.identifier: updatePreparations
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updatePreparations()
focal_class.class_method_signature: PreparationDatasetRowUpdater.updatePreparations(PreparationRepository repository)
focal_class.full_signature: public void updatePreparations(PreparationRepository repository)
focal_class.identifier: updatePreparations
focal_class.modifiers: public
focal_class.parameters: (PreparationRepository repository)
focal_class.return: void
focal_class.signature: void updatePreparations(PreparationRepository repository)
focal_class.class_method_signature: PreparationDatasetRowUpdater.addRowMetadata(Preparation preparation)
focal_class.full_signature: private Preparation addRowMetadata(Preparation preparation)
focal_class.identifier: addRowMetadata
focal_class.modifiers: private
focal_class.parameters: (Preparation preparation)
focal_class.return: Preparation
focal_class.signature: Preparation addRowMetadata(Preparation preparation)
focal_method.body: public void updatePreparations() {
          updatePreparations(preparationRepository);
      }
focal_method.class_method_signature: PreparationDatasetRowUpdater.updatePreparations()
focal_method.full_signature: public void updatePreparations()
focal_method.identifier: updatePreparations
focal_method.invocations: updatePreparations
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void updatePreparations()