@Test void testWiresCommandHandler() { FutureCallback<Object, Object> callback = new FutureCallback<>(); commandBus.dispatch(asCommandMessage("test"), callback); callback.getResult(1, TimeUnit.SECONDS); FutureCallback<Object, Object> callback2 = new FutureCallback<>(); commandBus.dispatch(asCommandMessage("test"), callback2); commandBus.dispatch(asCommandMessage(1L), callback2); callback.getResult(1, TimeUnit.SECONDS); Context.MyCommandHandler ch = applicationContext.getBean(Context.MyCommandHandler.class); assertTrue(ch.getCommands().contains("test")); verify(primaryCommandTargetResolver, timeout(100)).resolveTarget(any()); }
@SuppressWarnings("unchecked") private <T> T getBean(String beanName, Configuration configuration) { return (T) configuration.getComponent(ApplicationContext.class).getBean(beanName); }
SpringAxonAutoConfigurer implements ImportBeanDefinitionRegistrar, BeanFactoryAware { @SuppressWarnings("unchecked") private <T> T getBean(String beanName, Configuration configuration) { return (T) configuration.getComponent(ApplicationContext.class).getBean(beanName); } }
SpringAxonAutoConfigurer implements ImportBeanDefinitionRegistrar, BeanFactoryAware { @SuppressWarnings("unchecked") private <T> T getBean(String beanName, Configuration configuration) { return (T) configuration.getComponent(ApplicationContext.class).getBean(beanName); }  }
SpringAxonAutoConfigurer implements ImportBeanDefinitionRegistrar, BeanFactoryAware { @SuppressWarnings("unchecked") private <T> T getBean(String beanName, Configuration configuration) { return (T) configuration.getComponent(ApplicationContext.class).getBean(beanName); }  @Override void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry); @Override void setBeanFactory(BeanFactory beanFactory); }
SpringAxonAutoConfigurer implements ImportBeanDefinitionRegistrar, BeanFactoryAware { @SuppressWarnings("unchecked") private <T> T getBean(String beanName, Configuration configuration) { return (T) configuration.getComponent(ApplicationContext.class).getBean(beanName); }  @Override void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry); @Override void setBeanFactory(BeanFactory beanFactory); @SuppressWarnings("WeakerAccess")
    static final String AXON_CONFIGURATION_BEAN; @SuppressWarnings("WeakerAccess")
    static final String AXON_CONFIGURER_BEAN; }