@Test
public void getRevocationReasons_Success() throws Exception {

	Integer certficateId = 123;
	String token = "FSR&&%S*";
	String jsonStr = "{  \"username\": \"testusername1\",  \"password\": \"testpassword1\"}";
    Map<String, Object> requestMap = new HashMap<>();
    requestMap.put("access_token", "12345");
    requestMap.put("token_type", "type");
    when(ControllerUtil.parseJson(jsonStr)).thenReturn(requestMap);
    CertManagerLogin certManagerLogin = new CertManagerLogin();
    certManagerLogin.setToken_type("token type");
    certManagerLogin.setAccess_token("1234");
    CertResponse response = new CertResponse();
    response.setHttpstatus(HttpStatus.OK);
    response.setResponse(jsonStr);
    response.setSuccess(true);
    when(reqProcessor.processCert(eq("/auth/certmanager/login"), anyObject(), anyString(), anyString())).thenReturn(response);
    String jsonStr2 ="{\"time_enabled\":false,\"details_enabled\":false,\"reasons\":[{\"reason\":\"unspecified\",\"displayName\":\"Unspecified\"},{\"reason\":\"keyCompromise\",\"displayName\":\"Key compromise\"},{\"reason\":\"cACompromise\",\"displayName\":\"CA compromise\"},{\"reason\":\"affiliationChanged\",\"displayName\":\"Affiliation changed\"},{\"reason\":\"superseded\",\"displayName\":\"Superseded\"},{\"reason\":\"cessationOfOperation\",\"displayName\":\"Cessation of operation\"},{\"reason\":\"certificateHold\",\"displayName\":\"Certificate hold\"}]}";
    CertResponse revocationResponse = new CertResponse();
    revocationResponse.setHttpstatus(HttpStatus.OK);
    revocationResponse.setResponse(jsonStr2);
    revocationResponse.setSuccess(true);
    when(reqProcessor.processCert(eq("/certificates/revocationreasons"), anyObject(), anyString(), anyString())).thenReturn(revocationResponse);
    ResponseEntity<?> enrollResponse =
            sSLCertificateService.getRevocationReasons(certficateId, token);
    //Assert
    assertNotNull(enrollResponse);
    assertEquals(HttpStatus.OK, enrollResponse.getStatusCode());
}