getRepositoryService().createDeployment() doesn't read copied workflow

Hello, team. Kindly asking you for advice.
Due to copying workflow for tests(not using original) I refused to use Deployment annotation and was creating deployment programmatically. I was surprised that somehow camunda engine doesn’t see my newly generated workflow.

I tested file creation(see code) and it is right on the place in both cases. TRUE.
Case 1: When I am not removing “integration-test-rv-reverify-contact_ver_4.bpmn” as a result of 1st test run method addClasspathResource(“integration-test-rv-reverify-contact_ver_4.bpmn”) is working correctly.

Case 2: I am removing “integration-test-rv-reverify-contact_ver_4.bpmn”, invoke test, new workflow is generating by copying
source workflow, engine doesn’t see workflow and I am getting

org.camunda.bpm.engine.exception.NullValueException: resource ‘integration-test-rv-reverify-contact_ver_4.bpmn’ not found: inputStream is null

@ExtendWith(ProcessEngineExtension.class)
public class PreCheckFailIntegrationTest {

@Mock
private ProcessRepositoryService processRepositoryService;

@Mock
private ReverifyDataService reverifyDataService;

@Mock
private PreLaunchCheckService preLaunchCheckService;

@RegisterExtension
public ProcessEngineExtension extension = ProcessEngineExtension.builder()
        .configurationResource("camunda.cfg.xml")
        .build();

@BeforeEach
public void setUp() {
    MockitoAnnotations.openMocks(this);
}

@Test
public void testExecute() {
    WorkflowParser workflowParser = new WorkflowParser();
    File copied = workflowParser.copyWorkflow("rv-reverify-contact_ver_4");
    org.assertj.core.api.Assertions.assertThat(copied).exists();
    
    extension.getRepositoryService()
            .createDeployment()
            .addClasspathResource("integration-test-rv-reverify-contact_ver_4.bpmn")
            .deploy();

//etc

@Ingo_Richtsmeier What should I do to make camunda detect new created workflow?

P.S. integration-test- is just prefix added to new copied file. Copied workflow is put in test/resources directory.

Problem was solved this way

File workflowCopy = WorkflowParser.updateWorkflowForIntegrationTest(“rv-reverify-contact_ver_4”);
org.assertj.core.api.Assertions.assertThat(workflowCopy).exists();

    extension.getRepositoryService()
            .createDeployment()
            .addInputStream(workflowCopy.getName(), new FileInputStream(workflowCopy))
            .deploy();