OCSPReq req = gen.generate();
// Send the request and receive a singleResponse
SingleResp[] singleResps = helper.sendOCSPPost(req.getEncoded(), null, 0, 200);
assertEquals("No of SingResps should be 1.", 1, singleResps.length);
SingleResp singleResp = singleResps[0];
CertificateID certId = singleResp.getCertID();
assertEquals("Serno in response does not match serno in request.", certId.getSerialNumber(), ocspTestCert.getSerialNumber());
Object status = singleResp.getCertStatus();
assertTrue("Status is not RevokedStatus", status instanceof RevokedStatus);
RevokedStatus rev = (RevokedStatus) status;
assertTrue("Status does not have reason", rev.hasRevocationReason());
int reason = rev.getRevocationReason();
assertEquals("Wrong revocation reason", reason, RevokedCertInfo.REVOCATION_REASON_KEYCOMPROMISE);