Add a getJobId convenience method to StepContext

Resolves BATCH-2769
This commit is contained in:
Nicolas Widart
2018-10-18 12:25:45 +02:00
committed by Mahmoud Ben Hassine
parent 42c0614742
commit 131e02e3a3
2 changed files with 21 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2014 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,6 +37,7 @@ import org.springframework.batch.item.ExecutionContext;
/**
* @author Dave Syer
* @author Nicolas Widart
*
*/
public class StepContextTests {
@@ -164,6 +165,11 @@ public class StepContextTests {
assertEquals("job", context.getJobName());
}
@Test
public void testJobId() throws Exception {
assertEquals(2L, (long)context.getJobId());
}
@Test
public void testStepExecutionContext() throws Exception {
ExecutionContext executionContext = stepExecution.getExecutionContext();