com.networknt.eventuate.test.util.MockEventHandlerContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eventuate-testutil Show documentation
Show all versions of eventuate-testutil Show documentation
Test utility used by all test cases.
The newest version!
package com.networknt.eventuate.test.util;
import com.networknt.eventuate.common.*;
/**
*
* @param The aggregate type
* @param The aggregate's command type
* @param The event that will be processed
* @param The concrete command type that will be processed
*/
public class MockEventHandlerContext, CT extends Command, E extends Event, C extends CT> {
private final AggregateOperationInvocation aggregateOperationInvocation;
public final EntityWithIdAndVersion updatedEntity;
public final EventHandlerContext mock;
public MockEventHandlerContext(EntityWithIdAndVersion updatedEntity, AggregateOperationInvocation aggregateOperationInvocation, EventHandlerContext mock) {
this.updatedEntity = updatedEntity;
this.aggregateOperationInvocation = aggregateOperationInvocation;
this.mock = mock;
}
public C getCommand() {
return aggregateOperationInvocation.getCommand();
}
public static MockEventHandlerContextBuilder.MockEventHandlerContextBuilderWithEvent forEvent(E event) {
return MockEventHandlerContextBuilder.forEvent(event);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy