@Test void shouldReturnNullForOtherType() { ResolutionContext context = newContext(Parent.class); Resolution<?> result = getSingletonStoreHandler().resolve(context); assertThat(result, nullValue()); }
@Override public Resolution<?> resolve(ResolutionContext context) { if (SingletonStore.class.equals(context.getIdentifier().getTypeAsClass())) { Class<?> genericType = ReflectionUtils.getGenericType(context.getIdentifier().getType()); if (genericType == null) { throw new InjectorException("Singleton store fields must have concrete generic type. " + "Cannot get generic type for field in '" + context.getIdentifier().getTypeAsClass() + "'"); } return new SimpleResolution<>(new SingletonStoreImpl<>(genericType, context.getInjector())); } return null; }
SingletonStoreDependencyHandler implements Handler { @Override public Resolution<?> resolve(ResolutionContext context) { if (SingletonStore.class.equals(context.getIdentifier().getTypeAsClass())) { Class<?> genericType = ReflectionUtils.getGenericType(context.getIdentifier().getType()); if (genericType == null) { throw new InjectorException("Singleton store fields must have concrete generic type. " + "Cannot get generic type for field in '" + context.getIdentifier().getTypeAsClass() + "'"); } return new SimpleResolution<>(new SingletonStoreImpl<>(genericType, context.getInjector())); } return null; } }
SingletonStoreDependencyHandler implements Handler { @Override public Resolution<?> resolve(ResolutionContext context) { if (SingletonStore.class.equals(context.getIdentifier().getTypeAsClass())) { Class<?> genericType = ReflectionUtils.getGenericType(context.getIdentifier().getType()); if (genericType == null) { throw new InjectorException("Singleton store fields must have concrete generic type. " + "Cannot get generic type for field in '" + context.getIdentifier().getTypeAsClass() + "'"); } return new SimpleResolution<>(new SingletonStoreImpl<>(genericType, context.getInjector())); } return null; }  }
SingletonStoreDependencyHandler implements Handler { @Override public Resolution<?> resolve(ResolutionContext context) { if (SingletonStore.class.equals(context.getIdentifier().getTypeAsClass())) { Class<?> genericType = ReflectionUtils.getGenericType(context.getIdentifier().getType()); if (genericType == null) { throw new InjectorException("Singleton store fields must have concrete generic type. " + "Cannot get generic type for field in '" + context.getIdentifier().getTypeAsClass() + "'"); } return new SimpleResolution<>(new SingletonStoreImpl<>(genericType, context.getInjector())); } return null; }  @Override Resolution<?> resolve(ResolutionContext context); }
SingletonStoreDependencyHandler implements Handler { @Override public Resolution<?> resolve(ResolutionContext context) { if (SingletonStore.class.equals(context.getIdentifier().getTypeAsClass())) { Class<?> genericType = ReflectionUtils.getGenericType(context.getIdentifier().getType()); if (genericType == null) { throw new InjectorException("Singleton store fields must have concrete generic type. " + "Cannot get generic type for field in '" + context.getIdentifier().getTypeAsClass() + "'"); } return new SimpleResolution<>(new SingletonStoreImpl<>(genericType, context.getInjector())); } return null; }  @Override Resolution<?> resolve(ResolutionContext context);  }