@Test void testCreateNewAggregateInstance() { SpringWiredAggregate aggregate = testSubject.createAggregateRoot("id2", new GenericDomainEventMessage<>("SpringWiredAggregate", "id2", 0, "FirstEvent")); assertTrue(aggregate.isInitialized(), "Aggregate's init method not invoked"); assertNotNull(aggregate.getContext(), "ContextAware method not invoked"); assertEquals("it's here", aggregate.getSpringConfiguredName()); }
@Override public T createAggregateRoot(String aggregateIdentifier, DomainEventMessage<?> firstEvent) { return delegate.createAggregateRoot(aggregateIdentifier, firstEvent); }
SpringPrototypeAggregateFactory implements AggregateFactory<T>, InitializingBean,
                                                           ApplicationContextAware, BeanNameAware { @Override public T createAggregateRoot(String aggregateIdentifier, DomainEventMessage<?> firstEvent) { return delegate.createAggregateRoot(aggregateIdentifier, firstEvent); } }
SpringPrototypeAggregateFactory implements AggregateFactory<T>, InitializingBean,
                                                           ApplicationContextAware, BeanNameAware { @Override public T createAggregateRoot(String aggregateIdentifier, DomainEventMessage<?> firstEvent) { return delegate.createAggregateRoot(aggregateIdentifier, firstEvent); } SpringPrototypeAggregateFactory(String prototypeBeanName);  SpringPrototypeAggregateFactory(String prototypeBeanName, Map<Class<? extends T>, String> subtypes); }
SpringPrototypeAggregateFactory implements AggregateFactory<T>, InitializingBean,
                                                           ApplicationContextAware, BeanNameAware { @Override public T createAggregateRoot(String aggregateIdentifier, DomainEventMessage<?> firstEvent) { return delegate.createAggregateRoot(aggregateIdentifier, firstEvent); } SpringPrototypeAggregateFactory(String prototypeBeanName);  SpringPrototypeAggregateFactory(String prototypeBeanName, Map<Class<? extends T>, String> subtypes); @Override T createAggregateRoot(String aggregateIdentifier, DomainEventMessage<?> firstEvent); @SuppressWarnings("unchecked") @Override Class<T> getAggregateType(); @Override void setApplicationContext(ApplicationContext applicationContext); @Override void setBeanName(String beanName); @SuppressWarnings("unchecked") @Override void afterPropertiesSet(); }
SpringPrototypeAggregateFactory implements AggregateFactory<T>, InitializingBean,
                                                           ApplicationContextAware, BeanNameAware { @Override public T createAggregateRoot(String aggregateIdentifier, DomainEventMessage<?> firstEvent) { return delegate.createAggregateRoot(aggregateIdentifier, firstEvent); } SpringPrototypeAggregateFactory(String prototypeBeanName);  SpringPrototypeAggregateFactory(String prototypeBeanName, Map<Class<? extends T>, String> subtypes); @Override T createAggregateRoot(String aggregateIdentifier, DomainEventMessage<?> firstEvent); @SuppressWarnings("unchecked") @Override Class<T> getAggregateType(); @Override void setApplicationContext(ApplicationContext applicationContext); @Override void setBeanName(String beanName); @SuppressWarnings("unchecked") @Override void afterPropertiesSet();  }