InstanceSerializer { public static InstanceRefresh refreshFromSlime(Slime slime) { Cursor root = slime.get(); return new InstanceRefresh(Pkcs10CsrUtils.fromPem(requireField(CSR_FIELD, root).asString())); } private  InstanceSerializer(); static InstanceRegistration registrationFromSlime(Slime slime); static InstanceRefresh refreshFromSlime(Slime slime); static Slime identityToSlime(InstanceIdentity identity); static SignedIdentityDocument attestationDataToIdentityDocument(String attestationData);  }
@Test public void serialize_instance_refresh() { var csr = CertificateTester.createCsr(); var csrPem = Pkcs10CsrUtils.toPem(csr); var json = "{\"csr\": \"" + csrPem + "\"}"; var instanceRefresh = new InstanceRefresh(csr); var deserialized = InstanceSerializer.refreshFromSlime(SlimeUtils.jsonToSlime(json)); assertEquals(instanceRefresh, deserialized); }