Package org.springframework.amqp.core

Examples of org.springframework.amqp.core.AmqpTemplate.receiveAndConvert()


public class Consumer {
 
  public static void main(String[] args) {
    ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfiguration.class);
    AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);
    System.out.println("Received: " + amqpTemplate.receiveAndConvert());
  }

}
View Full Code Here


    }

    @Test
    public void testNoItemType() {
        final AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);
        when(amqpTemplate.receiveAndConvert()).thenReturn("foo");

        final AmqpItemReader<String> amqpItemReader = new AmqpItemReader<String>(amqpTemplate);
        assertEquals("foo", amqpItemReader.read());
    }
View Full Code Here

    }

    @Test
    public void testNonMessageItemType() {
        final AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);
        when(amqpTemplate.receiveAndConvert()).thenReturn("foo");

        final AmqpItemReader<String> amqpItemReader = new AmqpItemReader<String>(amqpTemplate);
        amqpItemReader.setItemType(String.class);

        assertEquals("foo", amqpItemReader.read());
View Full Code Here

    @Test
    public void testTypeMismatch() {
        final AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);

        when(amqpTemplate.receiveAndConvert()).thenReturn("foo");

        final AmqpItemReader<Integer> amqpItemReader = new AmqpItemReader<Integer>(amqpTemplate);
        amqpItemReader.setItemType(Integer.class);

        try {
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.