RESOLVED - BATCH-828: org.springframework.batch.item.file.MultiResourceItemReader should allow for no resources
return null on first read if the resource list is empty
This commit is contained in:
@@ -200,6 +200,15 @@ public class MultiResourceItemReaderIntegrationTests extends TestCase {
|
||||
assertSame(r2, resources[2]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty resource list is OK.
|
||||
*/
|
||||
public void testNoResourcesFound() throws Exception {
|
||||
tested.setResources(new Resource[] {});
|
||||
tested.open(ctx);
|
||||
|
||||
assertNull(tested.read());
|
||||
}
|
||||
private String readItem() throws Exception {
|
||||
Object result = tested.read();
|
||||
return result == null ? null : ((FieldSet) result).readString(0);
|
||||
|
||||
Reference in New Issue
Block a user