@Test
public void testStoreExtractedText() throws BinaryStoreException {

    String extractedText = "text-that-has-been-extracted";
    expect(s3Client.getObjectMetadata(BUCKET, TEST_KEY))
        .andReturn(new ObjectMetadata());
    Capture<CopyObjectRequest> copyRequestCapture = Capture.newInstance();
    expect(s3Client.copyObject(capture(copyRequestCapture))).andReturn(null);
    replayAll();
    BinaryValue binaryValue = createBinaryValue(TEST_KEY, TEST_CONTENT);
    s3BinaryStore.storeExtractedText(binaryValue, extractedText);
    CopyObjectRequest copyRequest = copyRequestCapture.getValue();
    assertEquals(BUCKET, copyRequest.getSourceBucketName());
    assertEquals(BUCKET, copyRequest.getDestinationBucketName());
    assertEquals(TEST_KEY, copyRequest.getSourceKey());
    assertEquals(TEST_KEY, copyRequest.getDestinationKey());
    assertEquals(extractedText, copyRequest.getNewObjectMetadata()
                                           .getUserMetadata()
                                           .get(S3BinaryStore.EXTRACTED_TEXT_KEY));
}