Package org.springframework.integration.core

Examples of org.springframework.integration.core.PollableChannel.receive()


    Scrobble scrobble2 = new Scrobble(user1, track1, false);

    Message message1 = new GenericMessage<Scrobble>(scrobble1);
    Message message2 = new GenericMessage<Scrobble>(scrobble2);
    PollableChannel scrobbleChannel = mock(PollableChannel.class);
    when(scrobbleChannel.receive()).thenReturn(message1, message2, null);
   
    scrobbleService.setScrobbleChannel(scrobbleChannel);
    scrobbleService.receive();
   
    assertNotNull(scrobbleService.userScrobbles);
View Full Code Here


    assertFalse(scrobble1.getStartTime().equals(scrobble2.getStartTime()));
   
    Message message1 = new GenericMessage<Scrobble>(scrobble1);
    Message message2 = new GenericMessage<Scrobble>(scrobble2);
    PollableChannel scrobbleChannel = mock(PollableChannel.class);
    when(scrobbleChannel.receive()).thenReturn(message1, message2, null);
   
    scrobbleService.setScrobbleChannel(scrobbleChannel);
    scrobbleService.receive();
   
    assertNotNull(scrobbleService.userScrobbles);
View Full Code Here

    Scrobble scrobble2 = new Scrobble(user2, track1, false);

    Message message1 = new GenericMessage<Scrobble>(scrobble1);
    Message message2 = new GenericMessage<Scrobble>(scrobble2);
    PollableChannel scrobbleChannel = mock(PollableChannel.class);
    when(scrobbleChannel.receive()).thenReturn(message1, message2, null);
   
    scrobbleService.setScrobbleChannel(scrobbleChannel);
    scrobbleService.receive();
   
    assertNotNull(scrobbleService.userScrobbles);
View Full Code Here

    Scrobble scrobble = new Scrobble(user1, track1, false);

    Message message = new GenericMessage<Scrobble>(scrobble);
    PollableChannel scrobbleChannel = mock(PollableChannel.class);
    when(scrobbleChannel.receive()).thenReturn(message, (Message) null);

    scrobbleService.setScrobbleChannel(scrobbleChannel);
    scrobbleService.receive();

    scrobbleService.scrobbleTracks();
View Full Code Here

    final Car.CarId carId = new Car.CarId( 1 );
    final Car car = new Car( carId, "Ford Mustang" );
    storeClient.put( carId, car );

    // when
    final Message<Car> received = (Message<Car>) inboundChannel.receive();

    // then
    Assert.assertEquals( car, received.getPayload() );

    context.close();
View Full Code Here

    // given
    final Person lukasz = new Person( "lukasz", "Lukasz", "Antoniak" );
    storeClient.put( lukasz.getId(), lukasz );

    // when
    final Message<Person> received = (Message<Person>) inboundChannel.receive();

    // then
    Assert.assertEquals( lukasz, received.getPayload() );

    context.close();
View Full Code Here

    // given
    final Person kinga = new Person( "kinga", "Kinga", "Mroz" );
    storeClient.put( kinga.getId(), kinga );

    // when
    final Message<Versioned<Person>> received = (Message<Versioned<Person>>) inboundChannel.receive();

    // then
    final Versioned found = storeClient.get( kinga.getId() );
    Assert.assertEquals( found, received.getPayload() );
View Full Code Here

    // given
    final Person robert = new Person( "robert", "Robert", "Antoniak" );
    storeClient.put( robert.getId(), robert );

    // when
    final Message<Person> received = (Message<Person>) inboundChannel.receive();

    // then
    Assert.assertEquals( robert, received.getPayload() );
    final Versioned found = storeClient.get( robert.getId() );
    Assert.assertNull( found );
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.