All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.networknt.eventuate.test.util.MockEventHandlerContext Maven / Gradle / Ivy

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