@Test
public void createsPasswordBasedKeyProxy() throws Exception {

  final PasswordEncryptionService subject = new PasswordEncryptionService(new TestPasswordKeyProxyFactory());
  final EncryptionKeyMetadata keyMetadata = new EncryptionKeyMetadata();
  keyMetadata.setEncryptionPassword("foobar");
  final KeyProxy keyProxy = subject.createKeyProxy(keyMetadata);
  assertThat(keyProxy, instanceOf(PasswordBasedKeyProxy.class));
}