@Test void shouldThrowForNullValueAssociatedToAnnotation() { assertThrows(InjectorException.class, () -> savedAnnotationsHandler.onAnnotation(Duration.class, null)); }
@Override public void onAnnotation(Class<? extends Annotation> annotation, Object object) { InjectorUtils.checkNotNull(object, "Object may not be null"); if (storedValues.containsKey(annotation)) { throw new InjectorException("Value already registered for @" + annotation.getSimpleName()); } storedValues.put(annotation, object); }
SavedAnnotationsHandler implements Handler { @Override public void onAnnotation(Class<? extends Annotation> annotation, Object object) { InjectorUtils.checkNotNull(object, "Object may not be null"); if (storedValues.containsKey(annotation)) { throw new InjectorException("Value already registered for @" + annotation.getSimpleName()); } storedValues.put(annotation, object); } }
SavedAnnotationsHandler implements Handler { @Override public void onAnnotation(Class<? extends Annotation> annotation, Object object) { InjectorUtils.checkNotNull(object, "Object may not be null"); if (storedValues.containsKey(annotation)) { throw new InjectorException("Value already registered for @" + annotation.getSimpleName()); } storedValues.put(annotation, object); }  }
SavedAnnotationsHandler implements Handler { @Override public void onAnnotation(Class<? extends Annotation> annotation, Object object) { InjectorUtils.checkNotNull(object, "Object may not be null"); if (storedValues.containsKey(annotation)) { throw new InjectorException("Value already registered for @" + annotation.getSimpleName()); } storedValues.put(annotation, object); }  @Override Resolution<?> resolve(ResolutionContext context); @Override void onAnnotation(Class<? extends Annotation> annotation, Object object); }
SavedAnnotationsHandler implements Handler { @Override public void onAnnotation(Class<? extends Annotation> annotation, Object object) { InjectorUtils.checkNotNull(object, "Object may not be null"); if (storedValues.containsKey(annotation)) { throw new InjectorException("Value already registered for @" + annotation.getSimpleName()); } storedValues.put(annotation, object); }  @Override Resolution<?> resolve(ResolutionContext context); @Override void onAnnotation(Class<? extends Annotation> annotation, Object object);  }