void shouldStartBp()

in ddm-data-factory-feign-client/it/java/com/epam/digital/data/platform/datafactory/factory/client/PlatformGatewayFeignClientIT.java [90:119]


  void shouldStartBp() {
    var targetRegistry = "testTargetRegistry";
    var expectedBody = "{\"resultVariables\":{\"variable\":\"variableValue\"}}";
    var headers = new HttpHeaders();
    headers.add("Content-Type", "application/json");
    headers.add("X-Access-Token", "token");
    var requestBody = StartBpRequest.builder()
        .businessProcessDefinitionKey("processDefinition")
        .startVariables(Map.of("startVar", "startValue"))
        .build();
    var requestBodyString = "{\"businessProcessDefinitionKey\":\"processDefinition\","
        + "\"startVariables\":{\"startVar\":\"startValue\"}}";

    mockPlatformGatewayFeignClient(StubRequest.builder()
        .path(String.format("/bp-gateway/%s/api/start-bp", targetRegistry))
        .method(HttpMethod.POST)
        .requestHeaders(headers)
        .requestBody(equalToJson(requestBodyString))
        .status(200)
        .responseHeaders(Map.of("Content-Type", List.of("application/json")))
        .responseBody(expectedBody)
        .build());

    var response = platformGatewayFeignClient.startBp(targetRegistry, requestBody,
        headers);

    assertThat(response).isNotNull();
    assertThat(response.getResponseBody().prop("resultVariables").prop("variable").value())
        .isEqualTo("variableValue");
  }