Add additional integration test for list values in step scope.
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface Collaborator {
|
||||
|
||||
String getName();
|
||||
|
||||
Collaborator getParent();
|
||||
|
||||
List<String> getList();
|
||||
|
||||
}
|
||||
@@ -39,6 +39,10 @@ public class StepScopePlaceholderIntegrationTests implements BeanFactoryAware {
|
||||
@Qualifier("ref")
|
||||
private Collaborator ref;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("list")
|
||||
private Collaborator list;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("bar")
|
||||
private Collaborator bar;
|
||||
@@ -101,4 +105,9 @@ public class StepScopePlaceholderIntegrationTests implements BeanFactoryAware {
|
||||
assertEquals("bar", value.getParent().getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testList() throws Exception {
|
||||
assertEquals("[bar]", list.getList().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class TestCollaborator implements Collaborator, Serializable {
|
||||
@@ -8,6 +9,16 @@ public class TestCollaborator implements Collaborator, Serializable {
|
||||
private String name;
|
||||
|
||||
private Collaborator parent;
|
||||
|
||||
private List<String> list;
|
||||
|
||||
public List<String> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<String> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public Collaborator getParent() {
|
||||
return parent;
|
||||
|
||||
Reference in New Issue
Block a user