Search in sources :

Example 1 with AddTask

use of io.spine.test.procman.command.AddTask in project core-java by SpineEventEngine.

the class ProcessManagerRepositoryShould method setUp.

@Override
@Before
public void setUp() {
    super.setUp();
    boundedContext = TestBoundedContextFactory.MultiTenant.newBoundedContext();
    boundedContext.getCommandBus().register(new CommandDispatcher() {

        @Override
        public Set<CommandClass> getMessageClasses() {
            return CommandClass.setOf(AddTask.class);
        }

        @Override
        public void dispatch(CommandEnvelope envelope) {
        /* Simply swallow the command. We need this dispatcher for allowing
                                 Process Manager under test to route the AddTask command. */
        }
    });
    repository = new TestProcessManagerRepository(boundedContext);
    repository.initStorage(storageFactory());
    TestProcessManager.clearMessageDeliveryHistory();
}
Also used : Set(java.util.Set) AddTask(io.spine.test.procman.command.AddTask) CommandDispatcher(io.spine.server.commandbus.CommandDispatcher) CommandEnvelope(io.spine.envelope.CommandEnvelope) Before(org.junit.Before)

Aggregations

CommandEnvelope (io.spine.envelope.CommandEnvelope)1 CommandDispatcher (io.spine.server.commandbus.CommandDispatcher)1 AddTask (io.spine.test.procman.command.AddTask)1 Set (java.util.Set)1 Before (org.junit.Before)1