@Test(expected = RepositoryException.class) public void getPageExperimentListExceptionTest() { doThrow(ReadTimeoutException.class).when(appPageIndexAccessor).selectBy(any(String.class)); Map<Page.Name, List<PageExperiment>> result = spyRepository.getPageExperimentList( APPLICATION_NAME ); assertThat(1, is(2)); }
@Override public Map<Page.Name, List<PageExperiment>> getPageExperimentList(Application.Name applicationName) { Stream<AppPage> resultList = getAppPagesFromCassandra(applicationName); ImmutableMap.Builder<Page.Name, List<PageExperiment>> result = ImmutableMap.builder(); resultList.forEach(t -> { Page page = new Page.Builder().withName(Page.Name.valueOf(t.getPage())).build(); List<PageExperiment> pageExperiments = getExperiments(applicationName, page.getName()); result.put(page.getName(), pageExperiments); }); return result.build(); }
CassandraPagesRepository implements PagesRepository { @Override public Map<Page.Name, List<PageExperiment>> getPageExperimentList(Application.Name applicationName) { Stream<AppPage> resultList = getAppPagesFromCassandra(applicationName); ImmutableMap.Builder<Page.Name, List<PageExperiment>> result = ImmutableMap.builder(); resultList.forEach(t -> { Page page = new Page.Builder().withName(Page.Name.valueOf(t.getPage())).build(); List<PageExperiment> pageExperiments = getExperiments(applicationName, page.getName()); result.put(page.getName(), pageExperiments); }); return result.build(); } }
CassandraPagesRepository implements PagesRepository { @Override public Map<Page.Name, List<PageExperiment>> getPageExperimentList(Application.Name applicationName) { Stream<AppPage> resultList = getAppPagesFromCassandra(applicationName); ImmutableMap.Builder<Page.Name, List<PageExperiment>> result = ImmutableMap.builder(); resultList.forEach(t -> { Page page = new Page.Builder().withName(Page.Name.valueOf(t.getPage())).build(); List<PageExperiment> pageExperiments = getExperiments(applicationName, page.getName()); result.put(page.getName(), pageExperiments); }); return result.build(); } @Inject  CassandraPagesRepository(ExperimentAccessor experimentAccessor,
                                    PageExperimentIndexAccessor pageExperimentIndexAccessor,
                                    ExperimentPageAccessor experimentPageAccessor,
                                    AppPageIndexAccessor appPageIndexAccessor,
                                    ExperimentAuditLogAccessor experimentAuditLogAccessor,
                                    MappingManager mappingManager); }
CassandraPagesRepository implements PagesRepository { @Override public Map<Page.Name, List<PageExperiment>> getPageExperimentList(Application.Name applicationName) { Stream<AppPage> resultList = getAppPagesFromCassandra(applicationName); ImmutableMap.Builder<Page.Name, List<PageExperiment>> result = ImmutableMap.builder(); resultList.forEach(t -> { Page page = new Page.Builder().withName(Page.Name.valueOf(t.getPage())).build(); List<PageExperiment> pageExperiments = getExperiments(applicationName, page.getName()); result.put(page.getName(), pageExperiments); }); return result.build(); } @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 Map<Page.Name, List<PageExperiment>> getPageExperimentList(Application.Name applicationName) { Stream<AppPage> resultList = getAppPagesFromCassandra(applicationName); ImmutableMap.Builder<Page.Name, List<PageExperiment>> result = ImmutableMap.builder(); resultList.forEach(t -> { Page page = new Page.Builder().withName(Page.Name.valueOf(t.getPage())).build(); List<PageExperiment> pageExperiments = getExperiments(applicationName, page.getName()); result.put(page.getName(), pageExperiments); }); return result.build(); } @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);  }