EndpointCertificateMetadataSerializer { public static EndpointCertificateMetadata fromJsonString(String zkData) { return fromSlime(SlimeUtils.jsonToSlime(zkData).get()); }  static Slime toSlime(EndpointCertificateMetadata metadata); static EndpointCertificateMetadata fromSlime(Inspector inspector); static EndpointCertificateMetadata fromJsonString(String zkData);  }
@Test public void deserializeFromJson() { assertEquals( sample, EndpointCertificateMetadataSerializer.fromJsonString( "{\"keyName\":\"keyName\",\"certName\":\"certName\",\"version\":1,\"lastRequested\":0}")); }
@Test public void deserializeFromJsonWithRequestMetadata() { assertEquals( sampleWithRequestMetadata, EndpointCertificateMetadataSerializer.fromJsonString( "{\"keyName\":\"keyName\",\"certName\":\"certName\",\"version\":1,\"lastRequested\":0,\"requestId\":\"requestId\",\"requestedDnsSans\":[\"SAN1\",\"SAN2\"],\"issuer\":\"issuer\"}")); }
@Test public void deserializeFromJsonWithDefaultLastRequested() { assertEquals( new EndpointCertificateMetadata("keyName", "certName", 1, 1597200000), EndpointCertificateMetadataSerializer.fromJsonString( "{\"keyName\":\"keyName\",\"certName\":\"certName\",\"version\":1}")); }