Search in sources :

Example 6 with ImportRequest

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

the class VCertTknClientTest method importCertificateWithServerError.

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

Aggregations

ImportRequest (com.venafi.vcert.sdk.certificate.ImportRequest)6 Test (org.junit.jupiter.api.Test)6 DisplayName (org.junit.jupiter.api.DisplayName)4 ImportResponse (com.venafi.vcert.sdk.certificate.ImportResponse)2 FeignException (feign.FeignException)2