void shouldFailEmailAddressValidationWhenAddressIsEmptyForOfficer()

in src/it/java/com/epam/digital/data/platform/settings/api/controller/SettingsControllerIT.java [286:300]


  void shouldFailEmailAddressValidationWhenAddressIsEmptyForOfficer() throws Exception {
    var input = new SettingsEmailInputDto();
    input.setAddress("");

    mockMvc
        .perform(
            post(BASE_URL + "/me/channels/email/validate")
                .header(X_ACCESS_TOKEN.getHeaderName(), TOKEN_OFFICER)
                .content(objectMapper.writeValueAsString(input))
                .contentType(MediaType.APPLICATION_JSON))
        .andExpectAll(status().isUnprocessableEntity(),
            content().contentType(MediaType.APPLICATION_JSON),
            jsonPath("$.message", is("Email address is empty")),
            jsonPath("$.localizedMessage", is("Поле обов'язкове")));
  }