in component-test/src/main/java/org/apache/fineract/cn/customer/IdentificationApiDocumentation.java [275:301]
public void documentDeleteIdCardWithScan ( ) throws Exception {
final Customer customer = CustomerGenerator.createRandomCustomer();
customer.setIdentifier("ana");
this.customerManager.createCustomer(customer);
this.eventRecorder.wait(CustomerEventConstants.POST_CUSTOMER, customer.getIdentifier());
final String customerIdentifier = customer.getIdentifier();
final IdentificationCard identificationCard = IdentificationCardGenerator.createRandomIdentificationCard();
identificationCard.setNumber("FET20Z234");
this.customerManager.createIdentificationCard(customerIdentifier, identificationCard);
this.eventRecorder.wait(CustomerEventConstants.POST_IDENTIFICATION_CARD, identificationCard.getNumber());
final String identificationCardNumber = identificationCard.getNumber();
final IdentificationCardScan scan = ScanGenerator.createRandomScan(null);
scan.setIdentifier("myScan");
scan.setDescription("My Own Scan");
this.postIdentificationCardScan(customerIdentifier, identificationCardNumber, scan);
final String scanIdentifier = scan.getIdentifier();
this.mockMvc.perform(delete("/customers/" + customerIdentifier + "/identifications/"
+ identificationCardNumber + "/scans/" + scanIdentifier)
.accept(MediaType.ALL_VALUE)
.contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(status().isAccepted())
.andDo(document("document-delete-id-card-with-scan", preprocessRequest(prettyPrint()), preprocessResponse(prettyPrint())));
}