@Test
public void testMapDateComparedToParameterParser() {

    final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DomainParameterParser.DATE_FORMAT_WITH_TIMESTAMP);
    final Date now = new Date();
    final JobParameter jobParameter = new JobParameter();
    jobParameter.setParameter(now);
    jobParameter.setParameterType(ParameterType.DATE);
    final JobParameter jobParameter2 = new JobParameter();
    jobParameter2.setParameter(now);
    jobParameter2.setParameterType(ParameterType.DATE);
    final Map<String, JobParameter> parameterMap = new HashMap<>();
    parameterMap.put("date_parameter", jobParameter);
    parameterMap.put("second_date", jobParameter2);
    final JobParameters jobParameters = new JobParameters();
    jobParameters.setParameters(parameterMap);
    final org.springframework.batch.core.JobParameters result = ResourceToDomainMapper.map(jobParameters);
    assertThat(result).isNotNull();
    assertThat(result.getParameters()).hasSize(2);
    final Date resultDate = result.getDate("date_parameter");
    final Date resultDate2 = result.getDate("second_date");
    final Date parserResult = DomainParameterParser.parseDate(simpleDateFormat.format(now));
    assertThat(resultDate).isEqualTo(parserResult);
    assertThat(resultDate2).isEqualTo(parserResult);
}