public void documentDeleteIdCardScan()

in component-test/src/main/java/org/apache/fineract/cn/customer/IdentificationApiDocumentation.java [404:431]


  public void documentDeleteIdCardScan ( ) throws Exception {
    final Customer customer = CustomerGenerator.createRandomCustomer();
    customer.setIdentifier("wabah");

    this.customerManager.createCustomer(customer);
    this.eventRecorder.wait(CustomerEventConstants.POST_CUSTOMER, customer.getIdentifier());
    final String customerIdentifier = customer.getIdentifier();

    final IdentificationCard identificationCard = IdentificationCardGenerator.createRandomIdentificationCard();
    identificationCard.setNumber("SC012A001");
    this.customerManager.createIdentificationCard(customerIdentifier, identificationCard);
    this.eventRecorder.wait(CustomerEventConstants.POST_IDENTIFICATION_CARD, identificationCard.getNumber());
    final String identificationCardNumber = identificationCard.getNumber();

    final IdentificationCardScan createdScan = ScanGenerator.createRandomScan(null);
    this.postIdentificationCardScan(customerIdentifier, identificationCardNumber, createdScan);

    createdScan.setIdentifier("justScan");
    createdScan.setDescription("Just Scan");
    Assert.assertNotNull(createdScan);

    this.mockMvc.perform(delete("/customers/" + customerIdentifier + "/identifications/"
            + identificationCardNumber + "/scans/" + createdScan.getIdentifier())
            .accept(MediaType.ALL_VALUE)
            .contentType(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(status().isAccepted())
            .andDo(document("document-delete-id-card-scan", preprocessRequest(prettyPrint()), preprocessResponse(prettyPrint())));
  }