@Test
public void testAESBinaryManager() throws Exception {

    AESBinaryManager binaryManager = new AESBinaryManager();
    BinaryManagerDescriptor descriptor = new BinaryManagerDescriptor();
    String options = String.format("%s=%s", PARAM_PASSWORD, "mypassword");
    descriptor.key = options;
    binaryManager.initialize(descriptor);
    Binary binary = binaryManager.getBinary(CONTENT_MD5);
    assertNull(binary);
    // store binary
    byte[] bytes = CONTENT.getBytes(UTF8);
    binary = binaryManager.getBinary(new ByteArrayInputStream(bytes));
    assertNotNull(binary);
    assertEquals(CONTENT_MD5, binary.getDigest());
    // get binary
    binary = binaryManager.getBinary(CONTENT_MD5);
    assertNotNull(binary);
    assertEquals(bytes.length, binary.getLength());
    try (InputStream stream = binary.getStream()) {
        assertEquals(CONTENT, IOUtils.toString(stream, UTF8));
    }
    binaryManager.close();
}