@Test
public void test_updateOnboardedServiceAccount_failure_not_onboarded() throws Exception {

    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"errors\":[\"Failed to update onboarded Service Account. Please onboard this Service Account first and try again.\"]}");
    String token = "5PDrOhsy4ig8L3EpsJZSLAMg";
    UserDetails userDetails = getMockUser(true);
    ServiceAccount serviceAccount = generateServiceAccount("testacc02", "testacc01");
    Response response = getMockResponse(HttpStatus.OK, true, "{\"keys\":[\"testacc03\"]}");
    when(reqProcessor.process("/ad/serviceaccount/onboardedlist","{}",token)).thenReturn(response);
    ResponseEntity<String> responseEntityActual =  serviceAccountsService.updateOnboardedServiceAccount(token, serviceAccount, userDetails);
    assertEquals(HttpStatus.BAD_REQUEST, responseEntityActual.getStatusCode());
    assertEquals(responseEntityExpected, responseEntityActual);
}