@Test void checkEntityBuilders() { final List<Binding<EntityBuilder>> entityBuilderBindings = injector.findBindingsByType(TypeLiteral.get(EntityBuilder.class)); assertNotNull(entityBuilderBindings); assertFalse(entityBuilderBindings.isEmpty()); final List<EntityBuilder> builders = entityBuilderBindings.stream().map(b -> injector.getInstance(b.getKey())).collect(toList()); assertFalse(builders.isEmpty()); assertEquals(entityBuilderBindings.size(), builders.size()); final List<EntityBuilder> sortedBuilders = new ArrayList<>(new TreeSet<>(builders)); if (sortedBuilders.size() != builders.size()) { final List<String> missing = new ArrayList<>(); builders.forEach(b -> { if (!sortedBuilders.contains(b)) { missing.add(b.getClass().getSimpleName()); } }); fail("Following builders are missing while sorted by order: " + Arrays.toString(missing.toArray()) + ". Maybe an order conflict?"); } final BundleEntityBuilder bundleEntityBuilder = injector.getInstance(BundleEntityBuilder.class); assertNotNull(bundleEntityBuilder); assertNotNull(bundleEntityBuilder.getEntityBuilders()); assertFalse(bundleEntityBuilder.getEntityBuilders().isEmpty()); assertEquals(bundleEntityBuilder.getEntityBuilders().size(), builders.size()); assertTrue(bundleEntityBuilder.getEntityBuilders().containsAll(builders)); assertNotNull(injector.getInstance(BundleDocumentBuilder.class)); }
public static <T> T getInstance(Class<T> serviceClass) { return getInjector().getInstance(serviceClass); }
InjectionRegistry extends AbstractModule { public static <T> T getInstance(Class<T> serviceClass) { return getInjector().getInstance(serviceClass); } }
InjectionRegistry extends AbstractModule { public static <T> T getInstance(Class<T> serviceClass) { return getInjector().getInstance(serviceClass); } private  InjectionRegistry(); }
InjectionRegistry extends AbstractModule { public static <T> T getInstance(Class<T> serviceClass) { return getInjector().getInstance(serviceClass); } private  InjectionRegistry(); static Injector getInjector(); static T getInstance(Class<T> serviceClass); }
InjectionRegistry extends AbstractModule { public static <T> T getInstance(Class<T> serviceClass) { return getInjector().getInstance(serviceClass); } private  InjectionRegistry(); static Injector getInjector(); static T getInstance(Class<T> serviceClass);  }