public void documentUpdateEmailConfiguration()

in component-test/src/main/java/org/apache/fineract/cn/notification/EmailApiDocumentation.java [129:174]


  public void documentUpdateEmailConfiguration() throws Exception {
    
    final EmailConfiguration randomEmailConfiguration = DomainObjectGenerator.emailConfiguration();
    final EmailConfiguration newRandomConfiguration = DomainObjectGenerator.emailConfiguration();
    
    this.notificationManager.createEmailConfiguration(randomEmailConfiguration);
    
    super.eventRecorder.wait(NotificationEventConstants.POST_EMAIL_CONFIGURATION, randomEmailConfiguration.getIdentifier());
    
    newRandomConfiguration.setIdentifier(randomEmailConfiguration.getIdentifier());
    newRandomConfiguration.setHost("new.host.com");
    newRandomConfiguration.setApp_password("changePassword");
    newRandomConfiguration.setPort("554");
    newRandomConfiguration.setProtocol("pop3");
    newRandomConfiguration.setUsername("newaddress@example.com");
    newRandomConfiguration.setSmtp_auth("false");
    newRandomConfiguration.setStart_tls("false");
    newRandomConfiguration.setState("ACTIVE");
    
    notificationManager.updateEmailConfiguration(newRandomConfiguration);
    
    super.eventRecorder.wait(NotificationEventConstants.UPDATE_EMAIL_CONFIGURATION, newRandomConfiguration.getIdentifier());
    
    this.mockMvc.perform(put("/configuration/sms")
        .accept(MediaType.APPLICATION_JSON_VALUE)
        .contentType(MediaType.APPLICATION_JSON_VALUE)
        .content(gson.toJson(newRandomConfiguration)))
        .andExpect(status().isAccepted())
        .andDo(document("document-update-email-configuration", preprocessRequest(prettyPrint()),
            requestFields(
                fieldWithPath("identifier").description("Configuration Id for Email Server"),
                fieldWithPath("host").description("Email Server host address"),
                fieldWithPath("port").description("Email Server port number"),
                fieldWithPath("protocol").description("Type of protocol in use " +
                    "\nSMTP" +
                    "\nPOP3" +
                    "\nIMAP"),
                fieldWithPath("username").description("Email address"),
                fieldWithPath("app_password").description("Email app password or normal password"),
                fieldWithPath("smtp_auth").description("Enable SMTP"),
                fieldWithPath("start_tls").description("Enable TLS"),
                fieldWithPath("state").description("" +
                    "\n ACTIVE for Gateway to be used" +
                    "\n DEACTIVATED for inactive gateways")
            )));
  }