public void documentUploadPortrait()

in component-test/src/main/java/org/apache/fineract/cn/customer/CustomerApiDocumentation.java [1339:1392]


  public void documentUploadPortrait ( ) throws Exception {
    final Customer customer = CustomerGenerator.createRandomCustomer();

    DateOfBirth dateOfBirth = new DateOfBirth();
    dateOfBirth.setYear(Integer.valueOf(1995));
    dateOfBirth.setMonth(Integer.valueOf(6));
    dateOfBirth.setDay(Integer.valueOf(6));

    Address address = new Address();
    address.setStreet("Soppo");
    address.setCity("Buea");
    address.setRegion("SWR");
    address.setPostalCode("8050");
    address.setCountryCode("CM");
    address.setCountry("Cameroon");

    ContactDetail orangeContact = new ContactDetail();
    orangeContact.setType(ContactDetail.Type.MOBILE.name());
    orangeContact.setGroup(ContactDetail.Group.PRIVATE.name());
    orangeContact.setValue("699499349");
    orangeContact.setPreferenceLevel(Integer.valueOf(1));
    orangeContact.setValidated(Boolean.FALSE);

    List <ContactDetail> contactDetails = new ArrayList <>();
    contactDetails.add(orangeContact);

    customer.setIdentifier("ojong");
    customer.setType(Customer.Type.PERSON.name());
    customer.setGivenName("Ojong");
    customer.setMiddleName("Arrey");
    customer.setSurname("Bessong");
    customer.setDateOfBirth(dateOfBirth);
    customer.setMember(Boolean.TRUE);
    customer.setAssignedOffice("Bonduma");
    customer.setAssignedEmployee("Egbe E");
    customer.setAddress(address);
    customer.setContactDetails(contactDetails);
    customer.setCurrentState(Customer.State.PENDING.name());
    customer.setAccountBeneficiary("Wife");
    customer.setReferenceCustomer("kumba");
    customer.setApplicationDate(LocalDate.ofYearDay(2017, 301).toString());
    customer.setLastModifiedBy("Egbe E.");
    customer.setLastModifiedOn(LocalDate.ofYearDay(2018, 101).toString());

    this.customerManager.createCustomer(customer);
    this.eventRecorder.wait(CustomerEventConstants.POST_CUSTOMER, customer.getIdentifier());

    final MockMultipartFile portrait = new MockMultipartFile("portrait", "portrait.png", MediaType.IMAGE_PNG_VALUE, "i don't care".getBytes());

    this.mockMvc.perform(MockMvcRequestBuilders.fileUpload("/customers/" + customer.getIdentifier() + "/portrait")
            .file(portrait))
            .andExpect(status().isAccepted())
            .andDo(document("document-upload-portrait"));
  }