use of com.venafi.vcert.sdk.certificate.RevocationRequest in project vcert-java by Venafi.
the class VCertTknClientTest method revokeCertificate.
@Test
@DisplayName("Revoke certificate")
void revokeCertificate() throws VCertException {
final RevocationRequest revocationRequest = mock(RevocationRequest.class);
classUnderTest.revokeCertificate(revocationRequest);
verify(connector).revokeCertificate(revocationRequest);
}
use of com.venafi.vcert.sdk.certificate.RevocationRequest in project vcert-java by Venafi.
the class VCertTknClientTest method revokeCertificateWithServerError.
@Test
@DisplayName("Revoke certificate with server error")
void revokeCertificateWithServerError() throws VCertException {
final RevocationRequest revocationRequest = mock(RevocationRequest.class);
doThrow(new FeignException.InternalServerError("Error", request, "".getBytes())).when(connector).revokeCertificate(revocationRequest);
assertThrows(VCertException.class, () -> classUnderTest.revokeCertificate(revocationRequest));
}
use of com.venafi.vcert.sdk.certificate.RevocationRequest in project vcert-java by Venafi.
the class VCertClientTest method revokeCertificate.
@Test
@DisplayName("Revoke certificate")
void revokeCertificate() throws VCertException {
final RevocationRequest revocationRequest = mock(RevocationRequest.class);
classUnderTest.revokeCertificate(revocationRequest);
verify(connector).revokeCertificate(revocationRequest);
}
use of com.venafi.vcert.sdk.certificate.RevocationRequest in project vcert-java by Venafi.
the class TppTokenConnectorCertAT method revokeCertificate.
@Test
void revokeCertificate() throws VCertException, SocketException, UnknownHostException {
TppTokenConnector connector = connectorResource.connector();
ZoneConfiguration zoneConfiguration = connectorResource.zoneConfiguration();
CertificateRequest certificateRequest = connector.generateRequest(zoneConfiguration, connectorResource.certificateRequest());
String certificateId = connector.requestCertificate(certificateRequest, zoneConfiguration);
assertThat(certificateId).isNotNull();
// just wait for the certificate issuance
connector.retrieveCertificate(certificateRequest);
RevocationRequest revocationRequest = new RevocationRequest();
revocationRequest.reason("key-compromise");
revocationRequest.certificateDN(certificateRequest.pickupId());
connector.revokeCertificate(revocationRequest);
}
use of com.venafi.vcert.sdk.certificate.RevocationRequest in project vcert-java by Venafi.
the class TppConnectorCertAT method revokeCertificate.
@Test
void revokeCertificate() throws VCertException, SocketException, UnknownHostException {
TppConnector connector = connectorResource.connector();
ZoneConfiguration zoneConfiguration = connectorResource.zoneConfiguration();
CertificateRequest certificateRequest = connectorResource.certificateRequest();
certificateRequest = connector.generateRequest(zoneConfiguration, certificateRequest);
String certificateId = connector.requestCertificate(certificateRequest, zoneConfiguration);
assertThat(certificateId).isNotNull();
// just wait for the certificate issuance
connector.retrieveCertificate(certificateRequest);
RevocationRequest revocationRequest = new RevocationRequest();
revocationRequest.reason("key-compromise");
revocationRequest.certificateDN(certificateRequest.pickupId());
connector.revokeCertificate(revocationRequest);
}
Aggregations