Package org.axonframework.commandhandling

Examples of org.axonframework.commandhandling.GenericCommandMessage


    public void testInterceptCommand_FailedExecution() throws Throwable {
        RuntimeException mockException = new MockException();
        when(mockInterceptorChain.proceed()).thenThrow(mockException);
        UnitOfWork uow = DefaultUnitOfWork.startAndGet();

        GenericCommandMessage command = new GenericCommandMessage("Command!");
        try {
            testSubject.handle(command, uow, mockInterceptorChain);
        } catch (RuntimeException e) {
            assertSame(mockException, e);
        }
View Full Code Here


        verify(mockUnitOfWork).attachResource(ParameterResolverFactory.class.getName(), parameterResolverFactory);
    }

    @Test
    public void testHandlerDispatching_WithCustomCommandName() throws Throwable {
        Object actualReturnValue = testSubject.handle(new GenericCommandMessage("almostLong", 1L, null), mockUnitOfWork);
        assertEquals(1L, actualReturnValue);
        assertEquals(0, mockTarget.voidHandlerInvoked);
        assertEquals(0, mockTarget.returningHandlerInvoked);
        assertEquals(1, mockTarget.almostDuplicateReturningHandlerInvoked);
View Full Code Here

TOP

Related Classes of org.axonframework.commandhandling.GenericCommandMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.