}
@Test(dependsOnMethods = {"getLatestTest"})
public void getVersionTest() {
GetAttachmentResponse response = couchDatabase.get()
.attachment(attachDocId, latestRevision, "html")
.execute();
// Get html
assertEquals(response.getHttpStatus(), CouchHttpStatus.OK, response.getStringContent());
assertTrue(response.isOk());
assertEquals(response.getContentType(), CouchMediaType.TEXT_HTML);
assertNotNull(response.getDocumentRevision());
assertEquals(response.getStringContent(), htmlContent);
// Get image
response = couchDatabase.get().attachment(attachDocId, latestRevision, "image").execute();
assertEquals(response.getHttpStatus(), CouchHttpStatus.OK, response.getStringContent());
assertTrue(response.isOk());
assertEquals(response.getContentType(), CouchMediaType.IMAGE_JPEG);
assertNotNull(response.getDocumentRevision());
byte[] responseImageBytes = (byte[]) response.getContent();
assertEquals(responseImageBytes.length, aceOfSpacesBytes.length);
assertTrue(Arrays.equals(responseImageBytes, aceOfSpacesBytes));
}