void startBp()

in src/it/java/com/epam/digital/data/platform/bpwebservice/it/controller/StartBpControllerIT.java [54:80]


  void startBp() throws Exception {
    mockPutCephStartForm("happyPathBusinessProcess",
        fileContent("/startBp/happyPath/json/cephContent.json").replaceAll("[ \r\n]", ""));

    bpmsMockServer.addStubMapping(stubFor(
        post(urlPathEqualTo("/api/process-definition/key/happyPathBusinessProcess/start"))
            .withHeader("X-Access-Token", equalTo(testUserToken))
            .withRequestBody(matching(
                fileContent("/startBp/happyPath/json/startProcessBpRequestRegex.json")
                    .replaceAll("[ \r\n]", "")
                    .replaceAll("\\{", "\\\\{")))
            .willReturn(aResponse().withStatus(200)
                .withHeader("Content-Type", "application/json")
                .withBody(
                    fileContent("/startBp/happyPath/json/bpmsStartProcessBpResponse.json")))));

    var request = fileContent("/startBp/happyPath/json/startBpRequest.json");
    var expectedResponse = fileContent("/startBp/happyPath/json/startBpResponse.json");

    mockMvc.perform(MockMvcRequestBuilders.post("/api/start-bp")
            .accept(MediaType.APPLICATION_JSON)
            .contentType(MediaType.APPLICATION_JSON)
            .header("X-Access-Token", testUserToken)
            .content(request))
        .andExpect(status().isOk())
        .andExpect(content().json(expectedResponse));
  }