@Test @DisplayName("post command rejections") void postCommandRejections() { ProjectId id = ProjectId.newBuilder() .setId(newUuid()) .build(); PmThrowEntityAlreadyArchived commandMsg = PmThrowEntityAlreadyArchived.newBuilder() .setProjectId(id) .build(); Command command = requestFactory.createCommand(commandMsg); dispatchCommand(command); EntityAlreadyArchived expected = EntityAlreadyArchived.newBuilder() .setEntityId(pack(id)) .build(); assertTrue(TestProcessManager.processed(expected)); }
@Override public final void dispatchCommand(CommandEnvelope command) { checkNotNull(command); Optional<I> target = route(command); target.ifPresent(id -> inbox().send(command) .toHandler(id)); }
ProcessManagerRepository extends EventDispatchingRepository<I, P, S> implements CommandDispatcherDelegate, EventProducingRepository { @Override public final void dispatchCommand(CommandEnvelope command) { checkNotNull(command); Optional<I> target = route(command); target.ifPresent(id -> inbox().send(command) .toHandler(id)); } }
ProcessManagerRepository extends EventDispatchingRepository<I, P, S> implements CommandDispatcherDelegate, EventProducingRepository { @Override public final void dispatchCommand(CommandEnvelope command) { checkNotNull(command); Optional<I> target = route(command); target.ifPresent(id -> inbox().send(command) .toHandler(id)); } protected  ProcessManagerRepository(); }
ProcessManagerRepository extends EventDispatchingRepository<I, P, S> implements CommandDispatcherDelegate, EventProducingRepository { @Override public final void dispatchCommand(CommandEnvelope command) { checkNotNull(command); Optional<I> target = route(command); target.ifPresent(id -> inbox().send(command) .toHandler(id)); } protected  ProcessManagerRepository(); @Override @OverridingMethodsMustInvokeSuper void registerWith(BoundedContext context); @Override final EventBus eventBus(); @Override final ImmutableSet<EventClass> messageClasses(); @Override final ImmutableSet<EventClass> domesticEventClasses(); @Override final ImmutableSet<EventClass> externalEventClasses(); @Override final ImmutableSet<CommandClass> commandClasses(); @Override ImmutableSet<EventClass> outgoingEvents(); @Override final void dispatchCommand(CommandEnvelope command); @OverridingMethodsMustInvokeSuper @Override P create(I id); @Override final void store(P entity); @OverridingMethodsMustInvokeSuper @Override void close(); }
ProcessManagerRepository extends EventDispatchingRepository<I, P, S> implements CommandDispatcherDelegate, EventProducingRepository { @Override public final void dispatchCommand(CommandEnvelope command) { checkNotNull(command); Optional<I> target = route(command); target.ifPresent(id -> inbox().send(command) .toHandler(id)); } protected  ProcessManagerRepository(); @Override @OverridingMethodsMustInvokeSuper void registerWith(BoundedContext context); @Override final EventBus eventBus(); @Override final ImmutableSet<EventClass> messageClasses(); @Override final ImmutableSet<EventClass> domesticEventClasses(); @Override final ImmutableSet<EventClass> externalEventClasses(); @Override final ImmutableSet<CommandClass> commandClasses(); @Override ImmutableSet<EventClass> outgoingEvents(); @Override final void dispatchCommand(CommandEnvelope command); @OverridingMethodsMustInvokeSuper @Override P create(I id); @Override final void store(P entity); @OverridingMethodsMustInvokeSuper @Override void close();  }