Package org.springframework.integration

Examples of org.springframework.integration.Message


    messageChannelPartitionHandler = new MessageChannelPartitionHandler();
    //mock
    StepExecution masterStepExecution = mock(StepExecution.class);
    StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
    MessagingOperations operations = mock(MessagingOperations.class);
    Message message = mock(Message.class);
    //when
    when(message.getPayload()).thenReturn(Collections.emptyList());
    when(operations.receive((PollableChannel) anyObject())).thenReturn(message);
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);
   
    //execute
View Full Code Here


    messageChannelPartitionHandler = new MessageChannelPartitionHandler();
    //mock
    StepExecution masterStepExecution = mock(StepExecution.class);
    StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
    MessagingOperations operations = mock(MessagingOperations.class);
    Message message = mock(Message.class);
    PollableChannel replyChannel = mock(PollableChannel.class);
    //when
    when(message.getPayload()).thenReturn(Collections.emptyList());
    when(operations.receive(replyChannel)).thenReturn(message);
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);
    messageChannelPartitionHandler.setReplyChannel(replyChannel);
   
View Full Code Here

  public @ResponseBody String simple(@RequestBody String message) {
   
    Message<String> operation = MessageBuilder.withPayload(message).build();
    MessagingTemplate template = new MessagingTemplate();
    template.setReceiveTimeout(1000);
    Message response = template.sendAndReceive(inOperationChannel, operation);
    return response != null ? response.getPayload().toString() : null;
   
  }
View Full Code Here

    @Test
    public void endToEndLegQuoteTest() throws Exception {
        this.quoteRequestsChannel.send(MessageBuilder.withPayload(exampleLegQuote).build(), 1000);

            Message asXml = this.carQuotesChannel.receive(5000);
            assertNotNull(asXml);
            System.out.println(xmlDocToString((Document) asXml.getPayload()));

            asXml = this.flightQuotesChannel.receive(5000);
            System.out.println(asXml);
            System.out.println(xmlDocToString((Document) asXml.getPayload()));

            asXml = this.hotelQuotesChannel.receive(5000);
            System.out.println(asXml);
            System.out.println(xmlDocToString((Document) asXml.getPayload()));

    }
View Full Code Here

    SmsNotifiable smsNotifier;

    @Test
    public void notificationShouldArriveAtSmsAdapter() throws Exception {
        TripNotification notification = mock(TripNotification.class);
        Message tripNotificationMessage =
                MessageBuilder
                        .withPayload(notification)
                        .build();
        CountDownLatch notifierInvoked = new CountDownLatch(1);
        doAnswer(countsDownLatch(notifierInvoked))
View Full Code Here

    }

    @Test
    public void testToronto(){
        // 4118 is the Yahoo! WOEID (Where On Earth ID) for Toronto, Canada
        Message message = MessageBuilder.withPayload("4118").build();
        Message response = channelTemplate.sendAndReceive(message);
        System.out.println(response.getPayload());
    }
View Full Code Here

    SmsNotifiable smsNotifier;

    @Test
    public void notificationShouldArriveAtSmsAdapter() throws Exception {
        TripNotification notification = mock(TripNotification.class);
        Message tripNotificationMessage =
                MessageBuilder
                        .withPayload(notification)
                        .build();
        CountDownLatch notifierInvoked = new CountDownLatch(1);
        doAnswer(countsDownLatch(notifierInvoked))
View Full Code Here

TOP

Related Classes of org.springframework.integration.Message

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.