@Test public void testConflictingFactories() throws Exception { MockDefaultDeploymentFactory lowPrio = new MockDefaultDeploymentFactory("war", 0); MockDefaultDeploymentFactory highPrio = new MockDefaultDeploymentFactory("war", 1000); DefaultDeploymentCreator creator = new DefaultDeploymentCreator( lowPrio, highPrio ); DefaultDeploymentFactory factory = creator.getFactory( "war" ); assertThat( factory ).isSameAs( highPrio ); creator = new DefaultDeploymentCreator( highPrio, lowPrio ); factory = creator.getFactory( "war" ); assertThat( factory ).isSameAs( highPrio ); }
DefaultDeploymentFactory getFactory(String type) { return this.factories.get(type); }
DefaultDeploymentCreator { DefaultDeploymentFactory getFactory(String type) { return this.factories.get(type); } }
DefaultDeploymentCreator { DefaultDeploymentFactory getFactory(String type) { return this.factories.get(type); } @Inject  DefaultDeploymentCreator(@Any Instance<DefaultDeploymentFactory> factories);  DefaultDeploymentCreator(DefaultDeploymentFactory... factories);  DefaultDeploymentCreator(Iterable<DefaultDeploymentFactory> factories); }
DefaultDeploymentCreator { DefaultDeploymentFactory getFactory(String type) { return this.factories.get(type); } @Inject  DefaultDeploymentCreator(@Any Instance<DefaultDeploymentFactory> factories);  DefaultDeploymentCreator(DefaultDeploymentFactory... factories);  DefaultDeploymentCreator(Iterable<DefaultDeploymentFactory> factories); Archive<?> createDefaultDeployment(String type); }
DefaultDeploymentCreator { DefaultDeploymentFactory getFactory(String type) { return this.factories.get(type); } @Inject  DefaultDeploymentCreator(@Any Instance<DefaultDeploymentFactory> factories);  DefaultDeploymentCreator(DefaultDeploymentFactory... factories);  DefaultDeploymentCreator(Iterable<DefaultDeploymentFactory> factories); Archive<?> createDefaultDeployment(String type);  }