@Test(expected = ParseException.class) public void testIsNotValidCurrentCheckpoint() throws Exception { Boolean filter = dateCheckpointType.isValidCurrentCheckpoint(currentBadCheckPoint, context); }
@Override public Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context) { final String datePattern = getDatePattern(context); final String lastCheckpoint = context.get("lastCheckpoint"); int isValid = 0; try { final Date lastCheckpointAsDate = new SimpleDateFormat(datePattern).parse(lastCheckpoint); final Date currentCheckpointAsDate = new SimpleDateFormat(datePattern).parse((String) currentCheckpoint); isValid = currentCheckpointAsDate.compareTo(lastCheckpointAsDate); } catch (ParseException e) { e.printStackTrace(); } return isValid > 0; }
DateCheckpointType implements CheckpointType { @Override public Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context) { final String datePattern = getDatePattern(context); final String lastCheckpoint = context.get("lastCheckpoint"); int isValid = 0; try { final Date lastCheckpointAsDate = new SimpleDateFormat(datePattern).parse(lastCheckpoint); final Date currentCheckpointAsDate = new SimpleDateFormat(datePattern).parse((String) currentCheckpoint); isValid = currentCheckpointAsDate.compareTo(lastCheckpointAsDate); } catch (ParseException e) { e.printStackTrace(); } return isValid > 0; } }
DateCheckpointType implements CheckpointType { @Override public Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context) { final String datePattern = getDatePattern(context); final String lastCheckpoint = context.get("lastCheckpoint"); int isValid = 0; try { final Date lastCheckpointAsDate = new SimpleDateFormat(datePattern).parse(lastCheckpoint); final Date currentCheckpointAsDate = new SimpleDateFormat(datePattern).parse((String) currentCheckpoint); isValid = currentCheckpointAsDate.compareTo(lastCheckpointAsDate); } catch (ParseException e) { e.printStackTrace(); } return isValid > 0; }  }
DateCheckpointType implements CheckpointType { @Override public Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context) { final String datePattern = getDatePattern(context); final String lastCheckpoint = context.get("lastCheckpoint"); int isValid = 0; try { final Date lastCheckpointAsDate = new SimpleDateFormat(datePattern).parse(lastCheckpoint); final Date currentCheckpointAsDate = new SimpleDateFormat(datePattern).parse((String) currentCheckpoint); isValid = currentCheckpointAsDate.compareTo(lastCheckpointAsDate); } catch (ParseException e) { e.printStackTrace(); } return isValid > 0; }  @Override String buildFilter(Object fieldValue, Map<String, String> context); @Override String buildDefaultFilter(Map<String, String> context); @Override Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context); @Override Object parseFilter(Object o, Map<String, String> context); }
DateCheckpointType implements CheckpointType { @Override public Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context) { final String datePattern = getDatePattern(context); final String lastCheckpoint = context.get("lastCheckpoint"); int isValid = 0; try { final Date lastCheckpointAsDate = new SimpleDateFormat(datePattern).parse(lastCheckpoint); final Date currentCheckpointAsDate = new SimpleDateFormat(datePattern).parse((String) currentCheckpoint); isValid = currentCheckpointAsDate.compareTo(lastCheckpointAsDate); } catch (ParseException e) { e.printStackTrace(); } return isValid > 0; }  @Override String buildFilter(Object fieldValue, Map<String, String> context); @Override String buildDefaultFilter(Map<String, String> context); @Override Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context); @Override Object parseFilter(Object o, Map<String, String> context);  }