Search in sources :

Example 11 with CertificateRequest

use of com.venafi.vcert.sdk.certificate.CertificateRequest in project vcert-java by Venafi.

the class VCertClientTest method retrieveCertificate.

@Test
@DisplayName("Retrieve certificate")
void retrieveCertificate() throws VCertException {
    final CertificateRequest certificateRequest = mock(CertificateRequest.class);
    classUnderTest.retrieveCertificate(certificateRequest);
    verify(connector).retrieveCertificate(certificateRequest);
}
Also used : CertificateRequest(com.venafi.vcert.sdk.certificate.CertificateRequest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 12 with CertificateRequest

use of com.venafi.vcert.sdk.certificate.CertificateRequest in project vcert-java by Venafi.

the class VCertTknClientTest method retrieveCertificateWithServerError.

@Test
@DisplayName("Retrieve certificate with server error")
void retrieveCertificateWithServerError() throws VCertException {
    final CertificateRequest certificateRequest = mock(CertificateRequest.class);
    doThrow(new FeignException.InternalServerError("Error", request, "".getBytes())).when(connector).retrieveCertificate(certificateRequest);
    assertThrows(VCertException.class, () -> classUnderTest.retrieveCertificate(certificateRequest));
}
Also used : FeignException(feign.FeignException) CertificateRequest(com.venafi.vcert.sdk.certificate.CertificateRequest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 13 with CertificateRequest

use of com.venafi.vcert.sdk.certificate.CertificateRequest in project vcert-java by Venafi.

the class VCertTknClientTest method requestCertificate.

@Test
@DisplayName("Request certificate")
void requestCertificate() throws VCertException {
    final CertificateRequest certificateRequest = mock(CertificateRequest.class);
    final ZoneConfiguration zoneConfiguration = mock(ZoneConfiguration.class);
    zoneConfiguration.zoneId("test_zone");
    classUnderTest.requestCertificate(certificateRequest, zoneConfiguration);
    verify(connector).requestCertificate(certificateRequest, zoneConfiguration);
}
Also used : ZoneConfiguration(com.venafi.vcert.sdk.connectors.ZoneConfiguration) CertificateRequest(com.venafi.vcert.sdk.certificate.CertificateRequest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 14 with CertificateRequest

use of com.venafi.vcert.sdk.certificate.CertificateRequest in project vcert-java by Venafi.

the class VCertTknClientTest method retrieveCertificate.

@Test
@DisplayName("Retrieve certificate")
void retrieveCertificate() throws VCertException {
    final CertificateRequest certificateRequest = mock(CertificateRequest.class);
    classUnderTest.retrieveCertificate(certificateRequest);
    verify(connector).retrieveCertificate(certificateRequest);
}
Also used : CertificateRequest(com.venafi.vcert.sdk.certificate.CertificateRequest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 15 with CertificateRequest

use of com.venafi.vcert.sdk.certificate.CertificateRequest in project vcert-java by Venafi.

the class VCertTknClientTest method generateRequest.

@Test
@DisplayName("Generate request")
void generateRequest() throws VCertException {
    final ZoneConfiguration zoneConfiguration = mock(ZoneConfiguration.class);
    final CertificateRequest certificateRequest = mock(CertificateRequest.class);
    classUnderTest.generateRequest(zoneConfiguration, certificateRequest);
    verify(connector).generateRequest(zoneConfiguration, certificateRequest);
}
Also used : ZoneConfiguration(com.venafi.vcert.sdk.connectors.ZoneConfiguration) CertificateRequest(com.venafi.vcert.sdk.certificate.CertificateRequest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

CertificateRequest (com.venafi.vcert.sdk.certificate.CertificateRequest)53 Test (org.junit.jupiter.api.Test)44 ZoneConfiguration (com.venafi.vcert.sdk.connectors.ZoneConfiguration)43 DisplayName (org.junit.jupiter.api.DisplayName)24 PEMCollection (com.venafi.vcert.sdk.certificate.PEMCollection)20 RenewalRequest (com.venafi.vcert.sdk.certificate.RenewalRequest)9 Authentication (com.venafi.vcert.sdk.endpoint.Authentication)8 StringReader (java.io.StringReader)8 FeignException (feign.FeignException)7 X509Certificate (java.security.cert.X509Certificate)7 RevocationRequest (com.venafi.vcert.sdk.certificate.RevocationRequest)6 VCertException (com.venafi.vcert.sdk.VCertException)5 IOException (java.io.IOException)5 ArrayList (java.util.ArrayList)5 PEMParser (org.bouncycastle.openssl.PEMParser)5 CsrOriginOption (com.venafi.vcert.sdk.certificate.CsrOriginOption)4 DataFormat (com.venafi.vcert.sdk.certificate.DataFormat)4 Instant (java.time.Instant)4 BouncyCastleProvider (org.bouncycastle.jce.provider.BouncyCastleProvider)4 PKCS10CertificationRequest (org.bouncycastle.pkcs.PKCS10CertificationRequest)4