public void shouldUpdateSettings()

in ddm-bpm-extension/src/it/java/com/epam/digital/data/platform/bpms/extension/it/SettingsDelegateIT.java [60:89]


  public void shouldUpdateSettings() {
    userSettingsWireMock.stubFor(
        post(urlPathEqualTo("/user-settings-mock-server/api/settings/me/channels/email/deactivate"))
            .withHeader(PlatformHttpHeader.X_ACCESS_TOKEN.getName(), equalTo("token"))
            .withRequestBody(
                new EqualToJsonPattern(
                    convertJsonToString("/json/updateSettingsDeactivate.json"), false, false))
            .willReturn(
                aResponse().withStatus(200).withHeader("Content-type", "application/json")));
    userSettingsWireMock.stubFor(
        get(urlPathEqualTo("/user-settings-mock-server/api/settings/me"))
            .withHeader(PlatformHttpHeader.X_ACCESS_TOKEN.getName(), equalTo("token"))
            .willReturn(
                aResponse()
                    .withStatus(200)
                    .withHeader("Content-type", "application/json")
                    .withBody(convertJsonToString("/json/getSettingsAfterDeactivateResponse.json"))));

    var processInstance = runtimeService
            .startProcessInstanceByKey("update_settings_key",
                    Map.of("dataPayload", Spin.JSON(Map.of(
                            "e-mail", "test@test.com",
                            "phone", "+380444444444",
                            "communicationIsAllowed", true))));

    List<ProcessInstance> processInstanceList = runtimeService.createProcessInstanceQuery()
            .processInstanceId(processInstance.getId()).list();

    Assertions.assertThat(CollectionUtils.isEmpty(processInstanceList)).isTrue();
  }