Source:
<code>public void patchMultipleOperationsWithFailure() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .build(); String token = getAuthToken(admin.getEmail(), password); List<Operation> ops = new ArrayList<Operation>(); <START> ReplaceOperation replaceOperation0 = new ReplaceOperation("/canLogin", "true"); <END> ops.add(replaceOperation0); String patchBody = getPatchContent(ops); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.canLogIn", Matchers.is(true))); ReplaceOperation replaceOperation1 = new ReplaceOperation("/canLogin", "false"); ops.add(replaceOperation1); ReplaceOperation replaceOperation2 = new ReplaceOperation("/certificate", "true"); ops.add(replaceOperation2); ReplaceOperation replaceOperation3 = new ReplaceOperation("/cert", "false"); ops.add(replaceOperation3); ReplaceOperation replaceOperation4 = new ReplaceOperation("/certificate", "false"); ops.add(replaceOperation4); patchBody = getPatchContent(ops); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isBadRequest()); getClient(token).perform(get("/api/eperson/epersons/" + ePerson.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.canLogIn", Matchers.is(true))); }</code><technical_language>official true instead "true"</technical_language>

Target:
public void patchMultipleOperationsWithFailure() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .build(); String token = getAuthToken(admin.getEmail(), password); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation0 = new ReplaceOperation("/canLogin", true); ops.add(replaceOperation0); String patchBody = getPatchContent(ops); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.canLogIn", Matchers.is(true))); ReplaceOperation replaceOperation1 = new ReplaceOperation("/canLogin", false); ops.add(replaceOperation1); ReplaceOperation replaceOperation2 = new ReplaceOperation("/certificate", true); ops.add(replaceOperation2); ReplaceOperation replaceOperation3 = new ReplaceOperation("/nonexistentPath", "somevalue"); ops.add(replaceOperation3); ReplaceOperation replaceOperation4 = new ReplaceOperation("/certificate", false); ops.add(replaceOperation4); patchBody = getPatchContent(ops); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isBadRequest()); getClient(token).perform(get("/api/eperson/epersons/" + ePerson.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.canLogIn", Matchers.is(true))); }