Package org.axonframework.springmessaging

Examples of org.axonframework.springmessaging.StubDomainEvent


        verify(mockChannel).subscribe(isA(MessageHandler.class));
    }

    @Test
    public void testPublishEvent() {
        StubDomainEvent event = new StubDomainEvent();

        testSubject.publish(new GenericEventMessage<StubDomainEvent>(event));

        verify(mockChannel).send(messageContainingEvent(event));
    }
View Full Code Here


    @Test
    public void testMessageForwarded() {
        EventListener mockEventListener = mock(EventListener.class);
        MessageHandlerAdapter adapter = new MessageHandlerAdapter(mockEventListener);

        final StubDomainEvent payload = new StubDomainEvent();
        adapter.handleMessage(new GenericMessage<StubDomainEvent>(payload));
        adapter.handleMessage(new GenericMessage<StubDomainEvent>(new StubDomainEvent()));

        verify(mockEventListener, times(1)).handle(argThat(new BaseMatcher<EventMessage>() {
            @Override
            public boolean matches(Object o) {
                return ((o instanceof EventMessage) && ((EventMessage) o).getPayload().equals(payload));
View Full Code Here

        mockFilter = mock(EventFilter.class);
    }

    @Test
    public void testMessagePayloadIsPublished() {
        StubDomainEvent event = new StubDomainEvent();
        testSubject.handleMessage(new GenericMessage<Object>(event));

        verify(mockEventBus).publish(isA(EventMessage.class));
    }
View Full Code Here

    @SuppressWarnings({"unchecked"})
    public void testFilterRefusesEventMessage() {
        when(mockFilter.accept(isA(Class.class))).thenReturn(false);
        testSubject = new EventPublishingMessageChannelAdapter(mockEventBus, mockFilter);

        testSubject.handleMessage(new GenericMessage<Object>(new StubDomainEvent()));

        verifyZeroInteractions(mockEventBus);
    }
View Full Code Here

        testSubject = new EventListeningMessageChannelAdapter(mockEventBus, mockChannel);
    }

    @Test
    public void testMessageForwardedToChannel() {
        StubDomainEvent event = new StubDomainEvent();
        testSubject.handle(new GenericEventMessage<StubDomainEvent>(event));

        verify(mockChannel).send(messageWithPayload(event));
    }
View Full Code Here

TOP

Related Classes of org.axonframework.springmessaging.StubDomainEvent

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.