in component-test/src/main/java/org/apache/fineract/cn/customer/IdentificationApiDocumentation.java [216:250]
public void documentUpdateIdCard ( ) throws Exception {
String customerIdentifier = this.createCustomer();
final String identificationCardNumber = this.createIdentificationCard(customerIdentifier);
final IdentificationCard updatedIdentificationCard = IdentificationCardGenerator.createRandomIdentificationCard();
updatedIdentificationCard.setNumber(identificationCardNumber);
ExpirationDate expee = new ExpirationDate();
expee.setYear(2020);
expee.setMonth(1);
expee.setDay(1);
updatedIdentificationCard.setType("University");
updatedIdentificationCard.setExpirationDate(expee);
updatedIdentificationCard.setIssuer("UBuea");
Gson gson = new Gson();
this.mockMvc.perform(put("/customers/" + customerIdentifier + "/identifications/" + identificationCardNumber)
.contentType(MediaType.APPLICATION_JSON_VALUE)
.content(gson.toJson(updatedIdentificationCard))
.accept(MediaType.APPLICATION_JSON_VALUE))
.andExpect(status().isAccepted())
.andDo(document("document-update-id-card", preprocessRequest(prettyPrint()), preprocessResponse(prettyPrint()),
requestFields(
fieldWithPath("type").description("Type of Identity card"),
fieldWithPath("number").description("Identity card number"),
fieldWithPath("expirationDate").type("ExpirationDate").description("expiry date of card +\n" +
" +\n" +
" *class* _ExpirationDate_ { +\n" +
" *Integer* year, +\n" +
" *Integer* month, +\n" +
" *Integer* day, +\n" +
"} +"),
fieldWithPath("issuer").description("Issuer of identity Card"))));
}