@Test
public void testProcessNoConnectionsDuringDownload() throws Exception {

  final HttpRequestBase request = mock(HttpRequestBase.class);
  final S3ObjectInputStream stream =
      new S3ObjectInputStream(
          Resources.asByteSource(Resources.getResource("fixtures/s3_object.txt.gz")).openStream(),
          request);
  final ObjectMetadata metadata = new ObjectMetadata();
  metadata.setContentEncoding("gzip");
  final S3Object object = new S3Object();
  object.setObjectMetadata(metadata);
  object.setObjectContent(stream);
  when(broadcaster.test(anyString())).thenReturn(false, false, false, false, true);
  when(s3.fetch(any(S3EventNotificationRecord.class))).thenReturn(object);
  message.setBody(FixtureHelpers.fixture("fixtures/sns_notification.json"));
  final boolean actual = processor.test(message);
  verify(broadcaster, times(2)).isEmpty();
  verify(broadcaster, times(5)).test(anyString());
  verify(s3).fetch(any(S3EventNotificationRecord.class));
  verify(request).abort();
  assertThat(actual).isFalse();
}