@SuppressWarnings("unchecked") @Test void testPersistMetaAddDataAdd() { PersistResult persistResult = dataPersisterImpl.persist(dataProvider, MetadataMode.ADD, DataMode.ADD); assertEquals(create(of(entityType0.getId(), 2L, entityType1.getId(), 3L)), persistResult); InOrder inOrder = inOrder(metaDataService, dataService); inOrder.verify(metaDataService).addEntityType(entityType2); inOrder.verify(metaDataService).addEntityType(entityType1); inOrder.verify(dataService).add(eq(entityType1.getId()), any(Stream.class)); inOrder.verify(metaDataService).addEntityType(entityType0); inOrder.verify(dataService).add(eq(entityType0.getId()), any(Stream.class)); verifyNoMoreInteractions(metaDataService, dataService); }
@Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; }
DataPersisterImpl implements DataPersister { @Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; } }
DataPersisterImpl implements DataPersister { @Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; } DataPersisterImpl(
      MetaDataService metaDataService,
      DataService dataService,
      EntityTypeDependencyResolver entityTypeDependencyResolver); }
DataPersisterImpl implements DataPersister { @Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; } DataPersisterImpl(
      MetaDataService metaDataService,
      DataService dataService,
      EntityTypeDependencyResolver entityTypeDependencyResolver); @Transactional @Override PersistResult persist(
      DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode); }
DataPersisterImpl implements DataPersister { @Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; } DataPersisterImpl(
      MetaDataService metaDataService,
      DataService dataService,
      EntityTypeDependencyResolver entityTypeDependencyResolver); @Transactional @Override PersistResult persist(
      DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode);  }