CertificateIdentity { public CertificateIdentity(String domain, String service, List<String> roles, X509Certificate x509Certificate) { this.domain = domain; this.service = service; this.roles = roles; this.x509Certificate = x509Certificate; } CertificateIdentity(String domain, String service, List<String> roles, X509Certificate x509Certificate); String getPrincipalName(); String getDomain(); String getService(); List<String> getRoles(); X509Certificate getX509Certificate(); @Override String toString();  }
@Test public void testCertificateIdentity() throws Exception { X509Certificate cert = this.readCert("valid_cn_x509.cert"); CertificateIdentity certId = new CertificateIdentity("domain", "service", Arrays.asList("role_1", "role_2"), cert); assertNotNull(certId); assertEquals(certId.getDomain(), "domain"); assertEquals(certId.getService(), "service"); assertEquals(certId.getRoles(), Arrays.asList("role_1", "role_2")); assertSame(certId.getX509Certificate(), cert); }