@Test
public void test_processCallback_successful() {

    String state = "teststatecode";
    String code = "testauthcode";
    String pathStr = "?code="+code+"&state="+state;
    String responseJson = "{\n" +
            "\"client_token\": \"testmioJHmaUB1k7PB2wUDh\",\n" +
            "\"admin\": \"yes\",\n" +
            "\"access\": {\n" +
            "\"cert\": [{\n" +
            "\"test.company.com\": \"read\"\n" +
            "}],\n" +
            "\"svcacct\": [{\n" +
            "\"svc_test04\": \"write\"\n" +
            "}],\n" +
            "\"users\": [{\n" +
            "\"testsafe1\": \"read\"\n" +
            "}]\n" +
            "},\n" +
            "\"policies\": [\"default\"],\n" +
            "\"lease_duration\": 1800\n" +
            "}";
    Response response = getMockResponse(HttpStatus.OK, true, responseJson);
    when(reqProcessor.process("/auth/oidc/oidc/callback","{\"path\":\""+pathStr+"\"}","")).thenReturn(response);
    Map<String, Object> access = new HashMap<>();
    when(ControllerUtil.filterDuplicateSafePermissions(any())).thenReturn(access);
    when(ControllerUtil.filterDuplicateSvcaccPermissions(any())).thenReturn(access);
    when(JSONUtil.getJSON(any(Map.class))).thenReturn(responseJson);
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseJson);
    ResponseEntity<String> responseEntity = oidcAuthService.processOIDCCallback(state, code);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}