Add support to use any type as a job parameter

This commit also changes the way job parameters
are parsed and persisted.

NB: This commit should ideally have been split
into two change sets. But the changes are tightly
related that is was not possible to separate them.

Related to:

* https://github.com/spring-projects/spring-batch/issues/3960
* https://github.com/spring-projects/spring-batch/issues/2122
* https://github.com/spring-projects/spring-batch/issues/1035
* https://github.com/spring-projects/spring-batch/issues/1983
This commit is contained in:
Mahmoud Ben Hassine
2022-09-30 10:31:22 +02:00
parent 027302469a
commit 2660f2bb27
72 changed files with 2508 additions and 927 deletions

View File

@@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.configuration.JobRegistry;
import org.springframework.batch.core.configuration.support.ReferenceJobFactory;
import org.springframework.batch.core.launch.JobOperator;
@@ -61,7 +60,7 @@ class JobOperatorFunctionalTests {
@Test
void testStartStopResumeJob() throws Exception {
String params = new JobParametersBuilder().addLong("jobOperatorTestParam", 7L).toJobParameters().toString();
String params = "jobOperatorTestParam=7,java.lang.Long,true";
long executionId = operator.start(job.getName(), params);
assertEquals(params, operator.getParameters(executionId));