EndpointCertificateMetadataStore { public void writeEndpointCertificateMetadata(ApplicationId application, EndpointCertificateMetadata endpointCertificateMetadata) { try { Slime slime = new Slime(); EndpointCertificateMetadataSerializer.toSlime(endpointCertificateMetadata, slime.setObject()); curator.set(endpointCertificateMetadataPathOf(application), SlimeUtils.toJsonBytes(slime)); } catch (Exception e) { throw new RuntimeException("Could not write TLS secret key of " + application, e); } } EndpointCertificateMetadataStore(Curator curator, Path tenantPath); Optional<EndpointCertificateMetadata> readEndpointCertificateMetadata(ApplicationId application); void writeEndpointCertificateMetadata(ApplicationId application, EndpointCertificateMetadata endpointCertificateMetadata); CuratorTransaction delete(ApplicationId application);  }
@Test public void can_write_object_format() { var endpointCertificateMetadata = new EndpointCertificateMetadata("key-name", "cert-name", 1); endpointCertificateMetadataStore.writeEndpointCertificateMetadata(applicationId, endpointCertificateMetadata); assertEquals("{\"keyName\":\"key-name\",\"certName\":\"cert-name\",\"version\":1}", new String(curator.getData(endpointCertificateMetadataPath).orElseThrow())); }