@Test public void testGetState_multipleTasks() { List<TaskInfo> tasks = Arrays .asList(createTaskInfo(RebuildBrowseNodesTaskDescriptor.TYPE_ID, TaskState.RUNNING, "repo1"), createTaskInfo(RebuildBrowseNodesTaskDescriptor.TYPE_ID, TaskState.RUNNING, "repo2"), createTaskInfo(RebuildBrowseNodesTaskDescriptor.TYPE_ID, TaskState.RUNNING, "repo3")); when(taskScheduler.listsTasks()).thenReturn(tasks); Map<String, Object> state = underTest.getState(); assertThat(state.size(), is(2)); assertThat(state.get("rebuildingRepositories"), is(Sets.newHashSet("repo1", "repo2", "repo3"))); assertThat(state.get("browseTreeMaxNodes"), is(10)); }
@Override public Map<String, Object> getState() { Map<String, Object> state = new HashMap<>(); state.put("rebuildingRepositories", rebuildingRepositoriesCache.get()); state.put("browseTreeMaxNodes", browseNodeConfiguration.getMaxNodes()); return state; }
BrowseStateContributor implements StateContributor { @Override public Map<String, Object> getState() { Map<String, Object> state = new HashMap<>(); state.put("rebuildingRepositories", rebuildingRepositoriesCache.get()); state.put("browseTreeMaxNodes", browseNodeConfiguration.getMaxNodes()); return state; } }
BrowseStateContributor implements StateContributor { @Override public Map<String, Object> getState() { Map<String, Object> state = new HashMap<>(); state.put("rebuildingRepositories", rebuildingRepositoriesCache.get()); state.put("browseTreeMaxNodes", browseNodeConfiguration.getMaxNodes()); return state; } @Inject  BrowseStateContributor(
      final BrowseNodeConfiguration browseNodeConfiguration,
      final TaskScheduler taskScheduler,
      @Named("${nexus.coreui.state.rebuildingRepositoryTasksCacheTTL:-60}") long rebuildingRepositoriesCacheTTL); }
BrowseStateContributor implements StateContributor { @Override public Map<String, Object> getState() { Map<String, Object> state = new HashMap<>(); state.put("rebuildingRepositories", rebuildingRepositoriesCache.get()); state.put("browseTreeMaxNodes", browseNodeConfiguration.getMaxNodes()); return state; } @Inject  BrowseStateContributor(
      final BrowseNodeConfiguration browseNodeConfiguration,
      final TaskScheduler taskScheduler,
      @Named("${nexus.coreui.state.rebuildingRepositoryTasksCacheTTL:-60}") long rebuildingRepositoriesCacheTTL); @Override Map<String, Object> getState(); }
BrowseStateContributor implements StateContributor { @Override public Map<String, Object> getState() { Map<String, Object> state = new HashMap<>(); state.put("rebuildingRepositories", rebuildingRepositoriesCache.get()); state.put("browseTreeMaxNodes", browseNodeConfiguration.getMaxNodes()); return state; } @Inject  BrowseStateContributor(
      final BrowseNodeConfiguration browseNodeConfiguration,
      final TaskScheduler taskScheduler,
      @Named("${nexus.coreui.state.rebuildingRepositoryTasksCacheTTL:-60}") long rebuildingRepositoriesCacheTTL); @Override Map<String, Object> getState();  }