RESOLVED - BATCH-946: NullPointerException in MapStepExecutionDao.getStepExecutions

return empty list if there are no saved stepExecutions
This commit is contained in:
robokaso
2008-11-28 13:57:20 +00:00
parent dcc8994b49
commit 0fbb815989
2 changed files with 10 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -226,6 +227,12 @@ public abstract class AbstractStepExecutionDaoTests extends AbstractTransactiona
}
@Test
public void testGetStepExecutionsWhenNoneExist() throws Exception {
assertEquals("empty list is returned if no stepExecutions exist for given jobExecution", Collections
.emptyList(), dao.getStepExecutions(jobExecution));
}
private void assertStepExecutionsAreEqual(StepExecution expected, StepExecution actual) {
assertEquals(expected.getId(), actual.getId());
assertEquals(expected.getStartTime(), actual.getStartTime());