CompositeTokenConfiguration extends CompositeConfiguration<TokenConfiguration> implements TokenConfiguration { @NotNull @Override public TokenProvider getTokenProvider(@NotNull final Root root) { List<TokenProvider> providers = Lists.transform(getConfigurations(), new Function<TokenConfiguration, TokenProvider>() { @Override public TokenProvider apply(TokenConfiguration tokenConfiguration) { return tokenConfiguration.getTokenProvider(root); } }); return CompositeTokenProvider.newInstance(providers); } CompositeTokenConfiguration();  CompositeTokenConfiguration(@NotNull SecurityProvider securityProvider); @NotNull @Override TokenProvider getTokenProvider(@NotNull final Root root);  }
@Test public void testGetTokenProvider() { CompositeTokenConfiguration ctc = (CompositeTokenConfiguration) compositeConfiguration; Root root = Mockito.mock(Root.class); TokenProvider tp = ctc.getTokenProvider(root); assertNotNull(tp); assertFalse(tp instanceof CompositeTokenProvider); TokenConfiguration tc = createTokenConfiguration(); setDefault(tc); tp = ctc.getTokenProvider(root); assertNotNull(tp); assertFalse(tp instanceof CompositeTokenProvider); addConfiguration(tc); tp = ctc.getTokenProvider(root); assertNotNull(tp); assertFalse(tp instanceof CompositeTokenProvider); addConfiguration(createTokenConfiguration()); tp = ctc.getTokenProvider(root); assertNotNull(tp); assertTrue(tp instanceof CompositeTokenProvider); }