CompositeActionProvider implements AuthorizableActionProvider { @NotNull @Override public List<? extends AuthorizableAction> getAuthorizableActions(@NotNull SecurityProvider securityProvider) { List<AuthorizableAction> actions = Lists.newArrayList(); for (AuthorizableActionProvider p : providers) { actions.addAll(p.getAuthorizableActions(securityProvider)); } return actions; } CompositeActionProvider(Collection<? extends AuthorizableActionProvider> providers);  CompositeActionProvider(AuthorizableActionProvider... providers); @NotNull @Override List<? extends AuthorizableAction> getAuthorizableActions(@NotNull SecurityProvider securityProvider);  }
@Test public void testEmpty() { CompositeActionProvider cap = new CompositeActionProvider(); assertTrue(cap.getAuthorizableActions(securityProvider).isEmpty()); }
@Test public void testSingle() { AuthorizableActionProvider aap = new TestAuthorizableActionProvider(); assertEquals(aap.getAuthorizableActions(securityProvider), new CompositeActionProvider(aap).getAuthorizableActions(securityProvider)); }
@Test public void testMultiple() { AuthorizableActionProvider aap = new TestAuthorizableActionProvider(); AuthorizableActionProvider aap2 = new TestAuthorizableActionProvider(); assertEquals(ImmutableList.of(TestAction.INSTANCE, TestAction.INSTANCE), new CompositeActionProvider(aap, aap2).getAuthorizableActions(securityProvider)); }
@Test public void testMultiple2() { AuthorizableActionProvider aap = new TestAuthorizableActionProvider(); AuthorizableActionProvider aap2 = new TestAuthorizableActionProvider(); assertEquals(ImmutableList.of(TestAction.INSTANCE, TestAction.INSTANCE), new CompositeActionProvider(ImmutableList.of(aap, aap2)).getAuthorizableActions(securityProvider)); }