@Test public void conditionMatchers_BeanType() throws Exception { Set<CEKHandleConditionMatcher> matchers = cekRequestMappingHandlerMapping.conditionMatchers(TestHandler.class); assertThat(matchers) .hasSize(1) .anySatisfy(matcher -> assertThat(matcher).isInstanceOf(ExtensionIdConditionMatcher.class)); }
@SuppressWarnings({ "unchecked", "rawTypes" }) Set<CEKHandleConditionMatcher> conditionMatchers(Object beanTypeOrMethod) { Assert.isTrue(beanTypeOrMethod instanceof Class || beanTypeOrMethod instanceof Method, "beanTypeOrMethod should be Class or Method. " + "[beanTypeOrMethod:" + beanTypeOrMethod + "]"); Set<CEKHandleConditionMatcher> matchers = new HashSet<>(); for (Map.Entry<Class<? extends CEKHandleConditionMatcherFactory>, Set<Annotation>> entry : extractConditionMatcherFactories(beanTypeOrMethod).entrySet()) { CEKHandleConditionMatcher matcher = createHandleConditionMatcher(entry.getKey(), entry.getValue()); matchers.add(matcher); } return matchers; }
CEKRequestMappingHandlerMapping implements BeanFactoryAware, InitializingBean { @SuppressWarnings({ "unchecked", "rawTypes" }) Set<CEKHandleConditionMatcher> conditionMatchers(Object beanTypeOrMethod) { Assert.isTrue(beanTypeOrMethod instanceof Class || beanTypeOrMethod instanceof Method, "beanTypeOrMethod should be Class or Method. " + "[beanTypeOrMethod:" + beanTypeOrMethod + "]"); Set<CEKHandleConditionMatcher> matchers = new HashSet<>(); for (Map.Entry<Class<? extends CEKHandleConditionMatcherFactory>, Set<Annotation>> entry : extractConditionMatcherFactories(beanTypeOrMethod).entrySet()) { CEKHandleConditionMatcher matcher = createHandleConditionMatcher(entry.getKey(), entry.getValue()); matchers.add(matcher); } return matchers; } }
CEKRequestMappingHandlerMapping implements BeanFactoryAware, InitializingBean { @SuppressWarnings({ "unchecked", "rawTypes" }) Set<CEKHandleConditionMatcher> conditionMatchers(Object beanTypeOrMethod) { Assert.isTrue(beanTypeOrMethod instanceof Class || beanTypeOrMethod instanceof Method, "beanTypeOrMethod should be Class or Method. " + "[beanTypeOrMethod:" + beanTypeOrMethod + "]"); Set<CEKHandleConditionMatcher> matchers = new HashSet<>(); for (Map.Entry<Class<? extends CEKHandleConditionMatcherFactory>, Set<Annotation>> entry : extractConditionMatcherFactories(beanTypeOrMethod).entrySet()) { CEKHandleConditionMatcher matcher = createHandleConditionMatcher(entry.getKey(), entry.getValue()); matchers.add(matcher); } return matchers; }  }
CEKRequestMappingHandlerMapping implements BeanFactoryAware, InitializingBean { @SuppressWarnings({ "unchecked", "rawTypes" }) Set<CEKHandleConditionMatcher> conditionMatchers(Object beanTypeOrMethod) { Assert.isTrue(beanTypeOrMethod instanceof Class || beanTypeOrMethod instanceof Method, "beanTypeOrMethod should be Class or Method. " + "[beanTypeOrMethod:" + beanTypeOrMethod + "]"); Set<CEKHandleConditionMatcher> matchers = new HashSet<>(); for (Map.Entry<Class<? extends CEKHandleConditionMatcherFactory>, Set<Annotation>> entry : extractConditionMatcherFactories(beanTypeOrMethod).entrySet()) { CEKHandleConditionMatcher matcher = createHandleConditionMatcher(entry.getKey(), entry.getValue()); matchers.add(matcher); } return matchers; }  @Override void afterPropertiesSet(); }
CEKRequestMappingHandlerMapping implements BeanFactoryAware, InitializingBean { @SuppressWarnings({ "unchecked", "rawTypes" }) Set<CEKHandleConditionMatcher> conditionMatchers(Object beanTypeOrMethod) { Assert.isTrue(beanTypeOrMethod instanceof Class || beanTypeOrMethod instanceof Method, "beanTypeOrMethod should be Class or Method. " + "[beanTypeOrMethod:" + beanTypeOrMethod + "]"); Set<CEKHandleConditionMatcher> matchers = new HashSet<>(); for (Map.Entry<Class<? extends CEKHandleConditionMatcherFactory>, Set<Annotation>> entry : extractConditionMatcherFactories(beanTypeOrMethod).entrySet()) { CEKHandleConditionMatcher matcher = createHandleConditionMatcher(entry.getKey(), entry.getValue()); matchers.add(matcher); } return matchers; }  @Override void afterPropertiesSet();  }