@Test public void modulesWithSamePriorityGetSortedByName() throws Exception { AuthorizationModule aModule = new AModule(); AuthorizationModule bModule = new BModule(); AuthorizationModule cModule = new CModule(); this.moduleList.add(bModule); this.moduleList.add(aModule); this.moduleList.add(cModule); List<AuthorizationModule> expectedList = Arrays.asList( aModule, bModule, cModule); List<AuthorizationModule> actualList = this.mocker.getComponentUnderTest().get(); Assert.assertThat(actualList, is(expectedList)); }
@Override public List<AuthorizationModule> get() { try { List<AuthorizationModule> services = new LinkedList<>(); services.addAll(this.componentManager.<AuthorizationModule>getInstanceList(AuthorizationModule.class)); Collections.sort(services, AuthorizationModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up authorization modules", ex); } }
AuthorizationModuleListProvider implements Provider<List<AuthorizationModule>> { @Override public List<AuthorizationModule> get() { try { List<AuthorizationModule> services = new LinkedList<>(); services.addAll(this.componentManager.<AuthorizationModule>getInstanceList(AuthorizationModule.class)); Collections.sort(services, AuthorizationModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up authorization modules", ex); } } }
AuthorizationModuleListProvider implements Provider<List<AuthorizationModule>> { @Override public List<AuthorizationModule> get() { try { List<AuthorizationModule> services = new LinkedList<>(); services.addAll(this.componentManager.<AuthorizationModule>getInstanceList(AuthorizationModule.class)); Collections.sort(services, AuthorizationModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up authorization modules", ex); } }  }
AuthorizationModuleListProvider implements Provider<List<AuthorizationModule>> { @Override public List<AuthorizationModule> get() { try { List<AuthorizationModule> services = new LinkedList<>(); services.addAll(this.componentManager.<AuthorizationModule>getInstanceList(AuthorizationModule.class)); Collections.sort(services, AuthorizationModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up authorization modules", ex); } }  @Override List<AuthorizationModule> get(); }
AuthorizationModuleListProvider implements Provider<List<AuthorizationModule>> { @Override public List<AuthorizationModule> get() { try { List<AuthorizationModule> services = new LinkedList<>(); services.addAll(this.componentManager.<AuthorizationModule>getInstanceList(AuthorizationModule.class)); Collections.sort(services, AuthorizationModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up authorization modules", ex); } }  @Override List<AuthorizationModule> get();  }