Examples of StubDomainEvent


Examples of org.axonframework.integration.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

Examples of org.axonframework.integration.StubDomainEvent

    @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

Examples of org.axonframework.integration.StubDomainEvent

        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

Examples of org.axonframework.integration.StubDomainEvent

    @Test(expected = MessageRejectedException.class)
    public void testFilterRefusesEventMessage() {
        when(mockFilter.accept(isA(Class.class))).thenReturn(false);
        testSubject = new EventPublishingMessageChannelAdapter(mockEventBus, mockFilter);

        testSubject.handleMessage(new GenericMessage<Object>(new StubDomainEvent()));
    }
View Full Code Here

Examples of org.axonframework.integration.StubDomainEvent

        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

Examples of org.axonframework.integrationtests.commandhandling.StubDomainEvent

    public void testAppend() {
        String id = "blabla";
        String dbKey = "TEST." + id;
        jedis.del(dbKey);
        testSubject.appendEvents("TEST", new SimpleDomainEventStream(
                new GenericDomainEventMessage<StubDomainEvent>(id, 0, new StubDomainEvent()),
                new GenericDomainEventMessage<StubDomainEvent>(id, 1, new StubDomainEvent()),
                new GenericDomainEventMessage<StubDomainEvent>(id, 2, new StubDomainEvent()),
                new GenericDomainEventMessage<StubDomainEvent>(id, 3, new StubDomainEvent()),
                new GenericDomainEventMessage<StubDomainEvent>(id, 4, new StubDomainEvent()),
                new GenericDomainEventMessage<StubDomainEvent>(id, 5, new StubDomainEvent())));

        List<String> events = jedis.lrange(dbKey, 0, -1);
        for (String key : events) {
            System.out.println(key);
        }
View Full Code Here

Examples of org.axonframework.integrationtests.commandhandling.StubDomainEvent

        List<DomainEventMessage<StubDomainEvent>> events = new ArrayList<DomainEventMessage<StubDomainEvent>>();
        for (int t = 0; t < getTransactionSize(); t++) {
            events.add(new GenericDomainEventMessage<StubDomainEvent>(
                    aggregateId,
                    eventSequence++,
                    new StubDomainEvent(), null
            ));
        }
        eventStore.appendEvents("benchmark", new SimpleDomainEventStream(events));
        return eventSequence;
    }
View Full Code Here

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

Examples of org.axonframework.springmessaging.StubDomainEvent

    @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

Examples of org.axonframework.springmessaging.StubDomainEvent

        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
TOP
Copyright © 2018 www.massapi.com. 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.