WhiteboardAuthorizableActionProvider extends AbstractServiceTracker<AuthorizableActionProvider> implements AuthorizableActionProvider { @NotNull @Override public List<? extends AuthorizableAction> getAuthorizableActions(@NotNull SecurityProvider securityProvider) { AuthorizableActionProvider actionProvider = new CompositeActionProvider(getServices()); return actionProvider.getAuthorizableActions(securityProvider); } WhiteboardAuthorizableActionProvider(); @NotNull @Override List<? extends AuthorizableAction> getAuthorizableActions(@NotNull SecurityProvider securityProvider);  }
@Test public void testDefault() { List<? extends AuthorizableAction> actions = actionProvider.getAuthorizableActions(Mockito.mock(SecurityProvider.class)); assertNotNull(actions); assertTrue(actions.isEmpty()); }
@Test public void testStarted() { actionProvider.start(whiteboard); List<? extends AuthorizableAction> actions = actionProvider.getAuthorizableActions(Mockito.mock(SecurityProvider.class)); assertNotNull(actions); assertTrue(actions.isEmpty()); }
@Test public void testRegisteredImplementation() { actionProvider.start(whiteboard); AuthorizableActionProvider registered = securityProvider -> ImmutableList.of(new TestAction()); whiteboard.register(AuthorizableActionProvider.class, registered, ImmutableMap.of()); List<? extends AuthorizableAction> actions = actionProvider.getAuthorizableActions(Mockito.mock(SecurityProvider.class)); assertNotNull(actions); assertEquals(1, actions.size()); assertTrue(actions.get(0) instanceof TestAction); }