BatchContextParameters { public DateTime getFromIssueDate() { String fromIssueDate = getIssueDate(FROM_ISSUE_DATE); return DateTime.valueOf(fromIssueDate + "000000", Format.SIMPLE); }  DateTime getFromIssueDate(); DateTime getToIssueDate(); static final String FROM_ISSUE_DATE; static final String TO_ISSUE_DATE; }
@Test public void testFromIssueDate() { environment.setBatchArg(BatchContextParameters.FROM_ISSUE_DATE, "20111101"); environment.reload(); DateTime actual = parameters.getFromIssueDate(); assertThat(actual.getYear(), is(equalTo(2011))); assertThat(actual.getMonth(), is(equalTo(11))); assertThat(actual.getDay(), is(equalTo(01))); assertThat(actual.getHour(), is(equalTo(00))); assertThat(actual.getMinute(), is(equalTo(00))); assertThat(actual.getSecond(), is(equalTo(00))); }