public void documentUpdateSMSConfiguration()

in component-test/src/main/java/org/apache/fineract/cn/notification/SmsApiDocumentation.java [122:153]


  public void documentUpdateSMSConfiguration() throws Exception {
    final SMSConfiguration newRandomConfiguration = DomainObjectGenerator.smsConfiguration();
    final SMSConfiguration randomSMSConfiguration = DomainObjectGenerator.smsConfiguration();
    
    this.notificationManager.createSMSConfiguration(randomSMSConfiguration);
    
    super.eventRecorder.wait(NotificationEventConstants.POST_SMS_CONFIGURATION, randomSMSConfiguration.getIdentifier());
    
    newRandomConfiguration.setIdentifier(randomSMSConfiguration.getIdentifier());
    newRandomConfiguration.setSender_number("new.host.com");
    newRandomConfiguration.setState("ACTIVE");
    newRandomConfiguration.setAccount_sid("asdLAKSKFssdfasdf554");
    newRandomConfiguration.setAuth_token("aalkeifjlasdfalje333");
    
    notificationManager.updateSMSConfiguration(randomSMSConfiguration);
    
    this.mockMvc.perform(put("/configuration/sms")
        .accept(MediaType.APPLICATION_JSON_VALUE)
        .contentType(MediaType.APPLICATION_JSON_VALUE)
        .content(gson.toJson(randomSMSConfiguration)))
        .andExpect(status().isAccepted())
        .andDo(document("document-update-sms-configuration", preprocessRequest(prettyPrint()),
            requestFields(
                fieldWithPath("identifier").description("Configuration Id for SMS Gateway"),
                fieldWithPath("auth_token").description("SMS API authentication token"),
                fieldWithPath("account_sid").description("SMS API account SID"),
                fieldWithPath("sender_number").description("SMS API sender number"),
                fieldWithPath("state").description("The state of the Gateway" +
                    "\n ACTIVE for Gateway to be used" +
                    "\n DEACTIVATED for inactive gateways")
            )));
  }