byte[] encrypted = ByteStreams2.toByteArrayAndClose(new RSAEncryptingPayload(new JCECrypto(), Payloads.newPayload("fooya"), user
.getCertificate().getPublicKey()).openStream());
assertEquals(
ByteStreams2.toByteArrayAndClose(new RSADecryptingPayload(new JCECrypto(), Payloads.newPayload(encrypted), user.getPrivateKey()).openStream()),
"fooya".getBytes());
assertEquals(
handler.apply(HttpResponse.builder().statusCode(200).message("ok")
.payload(ParseClientFromJsonTest.class.getResourceAsStream("/client.json")).build()), user);