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

ai.stapi.test.disabledImplementations.DisabledCommandGateway Maven / Gradle / Ivy

There is a newer version: 0.2.3
Show newest version
package ai.stapi.test.disabledImplementations;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import org.axonframework.commandhandling.CommandCallback;
import org.axonframework.commandhandling.CommandMessage;
import org.axonframework.commandhandling.gateway.CommandGateway;
import org.axonframework.common.Registration;
import org.axonframework.messaging.MessageDispatchInterceptor;

public class DisabledCommandGateway implements CommandGateway {

  @Override
  public  void send(C c, CommandCallback commandCallback) {
    throw InvalidTestOperation.becauseTestCaseDoesntAllowSendingCommands();
  }

  @Override
  public  R sendAndWait(Object o) {
    throw InvalidTestOperation.becauseTestCaseDoesntAllowSendingCommands();
  }

  @Override
  public  R sendAndWait(Object o, long l, TimeUnit timeUnit) {
    throw InvalidTestOperation.becauseTestCaseDoesntAllowSendingCommands();
  }

  @Override
  public  CompletableFuture send(Object o) {
    throw InvalidTestOperation.becauseTestCaseDoesntAllowSendingCommands();
  }

  @Override
  public Registration registerDispatchInterceptor(
      MessageDispatchInterceptor> messageDispatchInterceptor) {
    return () -> false;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy