Add a getJobId convenience method to StepContext
Resolves BATCH-2769
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
42c0614742
commit
131e02e3a3
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user