@Test public void erasePageDataTest() { Experiment.ID experimentID = Experiment.ID.valueOf(experimentId); Page.Name pageName = Page.Name.valueOf("testPage1"); ExperimentPageList experimentPageList = new ExperimentPageList(); experimentPageList.addPage(ExperimentPage.withAttributes( pageName, true ) .build() ); doReturn(experimentPageList).when(spyRepository).getExperimentPages(eq(experimentID)); doNothing().when(spyRepository).deletePage(eq(APPLICATION_NAME), eq(experimentID), eq(pageName)); spyRepository.erasePageData(APPLICATION_NAME, experimentID); verify(spyRepository, times(1)).getExperimentPages(eq(experimentID)); verify(spyRepository, times(experimentPageList.getPages().size())) .deletePage(eq(APPLICATION_NAME), eq(experimentID), eq(pageName)); }
@Override public void erasePageData(Application.Name applicationName, Experiment.ID experimentID) { ExperimentPageList experimentPageList = getExperimentPages(experimentID); for (ExperimentPage experimentPage : experimentPageList.getPages()) { deletePage(applicationName, experimentID, experimentPage.getName()); logger.debug("CassandraPagesRepository Removing page: {} from terminated experiment: {} for application: {}", experimentPage.getName(), experimentID, applicationName); } }
CassandraPagesRepository implements PagesRepository { @Override public void erasePageData(Application.Name applicationName, Experiment.ID experimentID) { ExperimentPageList experimentPageList = getExperimentPages(experimentID); for (ExperimentPage experimentPage : experimentPageList.getPages()) { deletePage(applicationName, experimentID, experimentPage.getName()); logger.debug("CassandraPagesRepository Removing page: {} from terminated experiment: {} for application: {}", experimentPage.getName(), experimentID, applicationName); } } }
CassandraPagesRepository implements PagesRepository { @Override public void erasePageData(Application.Name applicationName, Experiment.ID experimentID) { ExperimentPageList experimentPageList = getExperimentPages(experimentID); for (ExperimentPage experimentPage : experimentPageList.getPages()) { deletePage(applicationName, experimentID, experimentPage.getName()); logger.debug("CassandraPagesRepository Removing page: {} from terminated experiment: {} for application: {}", experimentPage.getName(), experimentID, applicationName); } } @Inject  CassandraPagesRepository(ExperimentAccessor experimentAccessor,
                                    PageExperimentIndexAccessor pageExperimentIndexAccessor,
                                    ExperimentPageAccessor experimentPageAccessor,
                                    AppPageIndexAccessor appPageIndexAccessor,
                                    ExperimentAuditLogAccessor experimentAuditLogAccessor,
                                    MappingManager mappingManager); }
CassandraPagesRepository implements PagesRepository { @Override public void erasePageData(Application.Name applicationName, Experiment.ID experimentID) { ExperimentPageList experimentPageList = getExperimentPages(experimentID); for (ExperimentPage experimentPage : experimentPageList.getPages()) { deletePage(applicationName, experimentID, experimentPage.getName()); logger.debug("CassandraPagesRepository Removing page: {} from terminated experiment: {} for application: {}", experimentPage.getName(), experimentID, applicationName); } } @Inject  CassandraPagesRepository(ExperimentAccessor experimentAccessor,
                                    PageExperimentIndexAccessor pageExperimentIndexAccessor,
                                    ExperimentPageAccessor experimentPageAccessor,
                                    AppPageIndexAccessor appPageIndexAccessor,
                                    ExperimentAuditLogAccessor experimentAuditLogAccessor,
                                    MappingManager mappingManager); @Override void postPages(Application.Name applicationName, Experiment.ID experimentID, ExperimentPageList experimentPageList); @Override void deletePage(Application.Name applicationName, Experiment.ID experimentID, Page.Name pageName); @Override List<Page> getPageList(Application.Name applicationName); @Override Map<Page.Name, List<PageExperiment>> getPageExperimentList(Application.Name applicationName); @Override ExperimentPageList getExperimentPages(Experiment.ID experimentID); @Override List<PageExperiment> getExperiments(Application.Name applicationName, Page.Name pageName); @Override List<PageExperiment> getExperimentsWithoutLabels(Application.Name applicationName, Page.Name pageName); @Override Map<Pair<Application.Name, Page.Name>, List<PageExperiment>> getExperimentsWithoutLabels(Collection<Pair<Application.Name, Page.Name>> appAndPagePairs); @Override void erasePageData(Application.Name applicationName, Experiment.ID experimentID); }
CassandraPagesRepository implements PagesRepository { @Override public void erasePageData(Application.Name applicationName, Experiment.ID experimentID) { ExperimentPageList experimentPageList = getExperimentPages(experimentID); for (ExperimentPage experimentPage : experimentPageList.getPages()) { deletePage(applicationName, experimentID, experimentPage.getName()); logger.debug("CassandraPagesRepository Removing page: {} from terminated experiment: {} for application: {}", experimentPage.getName(), experimentID, applicationName); } } @Inject  CassandraPagesRepository(ExperimentAccessor experimentAccessor,
                                    PageExperimentIndexAccessor pageExperimentIndexAccessor,
                                    ExperimentPageAccessor experimentPageAccessor,
                                    AppPageIndexAccessor appPageIndexAccessor,
                                    ExperimentAuditLogAccessor experimentAuditLogAccessor,
                                    MappingManager mappingManager); @Override void postPages(Application.Name applicationName, Experiment.ID experimentID, ExperimentPageList experimentPageList); @Override void deletePage(Application.Name applicationName, Experiment.ID experimentID, Page.Name pageName); @Override List<Page> getPageList(Application.Name applicationName); @Override Map<Page.Name, List<PageExperiment>> getPageExperimentList(Application.Name applicationName); @Override ExperimentPageList getExperimentPages(Experiment.ID experimentID); @Override List<PageExperiment> getExperiments(Application.Name applicationName, Page.Name pageName); @Override List<PageExperiment> getExperimentsWithoutLabels(Application.Name applicationName, Page.Name pageName); @Override Map<Pair<Application.Name, Page.Name>, List<PageExperiment>> getExperimentsWithoutLabels(Collection<Pair<Application.Name, Page.Name>> appAndPagePairs); @Override void erasePageData(Application.Name applicationName, Experiment.ID experimentID);  }