Skip to content

MetaDataInstanceFactory.createStepExecution(JobParameters) does not propagate JobParameters to StepExecution #5115

@benelog

Description

@benelog

Bug description

StepExecution instances created via MetaDataInstanceFactory.createStepExecution(JobParameters) do not reference the provided JobParameters.

This appears to be a side effect introduced by the following commit:

90d8959

Environment

Spring Batch v6.0.0

Steps to reproduce

The following test case reproduces the bug:

@Test
void testCreateStepExecutionJobParameters() {
    JobParameters parameters = new JobParametersBuilder()
        .addString("foo", "bar")
        .toJobParameters();

    StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution(parameters);
    String paramValue = stepExecution.getJobExecution().getJobParameters().getString("foo");

    assertEquals("bar", paramValue);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions