/**
* Tests {@link SQS#receiveAllAtRate} where retrieving all results requires multiple requests.
*/
@Test
public void testMultiPageResult() throws Exception {
MessageApi messageClient = createMock(MessageApi.class);
ReceiveMessageOptions options = new ReceiveMessageOptions();
FluentIterable<Message> aMessage = FluentIterable.from(ImmutableSet.of(createMock(Message.class)));
FluentIterable<Message> noMessages = FluentIterable.from(ImmutableSet.<Message>of());
expect(messageClient.receive(1, options))
.andReturn(aMessage)
.times(2);
expect(messageClient.receive(1, options))
.andReturn(noMessages)
.once();
EasyMock.replay(messageClient);