CustomScopeAnnotationConfigurer implements BeanFactoryPostProcessor, Ordered { protected String deduceScopeName(MethodMetadata factoryMethodMetadata) { if (getAnnotationToScopeMappings() == null) { return null; } for (AnnotationToScopeMapping annotationToScopeMapping : getAnnotationToScopeMappings()) { if (factoryMethodMetadata.isAnnotated(annotationToScopeMapping.getAnnotation().getName())) { return annotationToScopeMapping.getScope(); } } return null; }  @Override void postProcessBeanFactory(ConfigurableListableBeanFactory clbf); void addMapping(Class<? extends Annotation> annotation, String scopeName); void addMapping(AnnotationToScopeMapping annotationToScopeMapping);  }
@Test public void testDeduceScopeName_nulls() { CustomScopeAnnotationConfigurer customScopeAnnotationConfigurer = new CustomScopeAnnotationConfigurer(); customScopeAnnotationConfigurer.setAnnotationToScopeMappings(null); assertThat(customScopeAnnotationConfigurer.deduceScopeName((AnnotationMetadata) null)).isNull(); assertThat(customScopeAnnotationConfigurer.deduceScopeName((MethodMetadata) null)).isNull(); }