@Test
public void testDeleteMessageException() throws Exception {

  doThrow(new AmazonServiceException("error"))
      .when(mockSQS)
      .deleteMessage(QUEUE_URL, "myReceipt");
  final Message message = new Message();
  message.setReceiptHandle("myReceipt");
  final boolean actual = iterator.deleteMessage(message);
  verify(mockSQS).deleteMessage(QUEUE_URL, "myReceipt");
  assertThat(actual).isFalse();
}