@Test
public void testIntegration() throws Exception {

    AttachmentContent attachmentContent = saveRemoteAttachment(url);
    assertThat(retrieveRemoteAttachments(DatabaseSettings.getConfiguredHttpClient(), dbName, downloadTimeout), is(1));
    assertThat(attachmentConnector.getAttachmentStream(attachmentContent, dummyUser,
                    new Project()
                            .setVisbility(Visibility.ME_AND_MODERATORS)
                            .setCreatedBy(dummyUser.getEmail())
                            .setAttachments(Collections.singleton(new Attachment().setAttachmentContentId(attachmentContent.getId())))),
            hasLength(greaterThan(0l)));
    assertThat(retrieveRemoteAttachments(DatabaseSettings.getConfiguredHttpClient(), dbName, downloadTimeout), is(0));
}