Search in sources :

Example 1 with CertContainer

use of org.nhindirect.config.store.Certificate.CertContainer in project nhin-d by DirectProject.

the class TrustBundleServiceTest method testUpdateTrustBundleAttributes.

public void testUpdateTrustBundleAttributes() throws Exception {
    X509Certificate cert = mock(X509Certificate.class);
    CertContainer container = mock(CertContainer.class);
    when(container.getCert()).thenReturn(cert);
    Certificate confCert = mock(Certificate.class);
    when(confCert.toCredential()).thenReturn(container);
    impl.updateTrustBundleAttributes(1234, "test bundle", "http://bundle/bundle", confCert, 8);
    verify(dao, times(1)).updateTrustBundleAttributes(eq((long) 1234), eq("test bundle"), eq("http://bundle/bundle"), (X509Certificate) any(), eq((int) 8));
}
Also used : X509Certificate(java.security.cert.X509Certificate) CertContainer(org.nhindirect.config.store.Certificate.CertContainer) X509Certificate(java.security.cert.X509Certificate) Certificate(org.nhindirect.config.store.Certificate)

Example 2 with CertContainer

use of org.nhindirect.config.store.Certificate.CertContainer in project nhin-d by DirectProject.

the class TrustBundleServiceTest method testUpdateTrustBundleSigningCertificate.

public void testUpdateTrustBundleSigningCertificate() throws Exception {
    X509Certificate cert = mock(X509Certificate.class);
    CertContainer container = mock(CertContainer.class);
    when(container.getCert()).thenReturn(cert);
    Certificate confCert = mock(Certificate.class);
    when(confCert.toCredential()).thenReturn(container);
    impl.updateTrustBundleSigningCertificate(1234, confCert);
    verify(dao, times(1)).updateTrustBundleSigningCertificate(eq((long) 1234), (X509Certificate) any());
}
Also used : X509Certificate(java.security.cert.X509Certificate) CertContainer(org.nhindirect.config.store.Certificate.CertContainer) X509Certificate(java.security.cert.X509Certificate) Certificate(org.nhindirect.config.store.Certificate)

Aggregations

X509Certificate (java.security.cert.X509Certificate)2 Certificate (org.nhindirect.config.store.Certificate)2 CertContainer (org.nhindirect.config.store.Certificate.CertContainer)2