BATCH-1208: add unit test
This commit is contained in:
@@ -6,6 +6,7 @@ import static org.junit.Assert.fail;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -35,6 +36,10 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
|
||||
@Qualifier("withInteger")
|
||||
private PlaceholderTargetSource withInteger;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("withList")
|
||||
private PlaceholderTargetSource withList;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("withMultiple")
|
||||
private PlaceholderTargetSource withMultiple;
|
||||
@@ -153,6 +158,13 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
|
||||
assertEquals("bar-4321", target.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetList() {
|
||||
Node target = (Node) withList.getTarget();
|
||||
assertEquals(3, target.getList().size());
|
||||
assertEquals("[bar, foo-4321, bar-4321]", target.getList().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetMultiple() {
|
||||
Node target = (Node) withMultiple.getTarget();
|
||||
@@ -186,6 +198,8 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
|
||||
Date getDate();
|
||||
|
||||
Node getParent();
|
||||
|
||||
List<String> getList();
|
||||
}
|
||||
|
||||
public static class Foo implements Node {
|
||||
@@ -195,6 +209,8 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
|
||||
private Date date;
|
||||
|
||||
private Node parent;
|
||||
|
||||
private List<String> list;
|
||||
|
||||
public Foo() {
|
||||
}
|
||||
@@ -227,6 +243,14 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void setList(List<String> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public List<String> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user