@Test public void shouldRejectExtraContent() { assertThat(placeholderHandler.evaluate("This is a test date 2020-01-01"), equalTo(ComparisonResult.DIFFERENT)); }
@Override public ComparisonResult evaluate(final String testText, final String... args) { if (args != null && args.length == 1) { return canParse(new SimpleDateFormat(args[0]), testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; } return canParse(testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; }
IsDateTimePlaceholderHandler implements PlaceholderHandler { @Override public ComparisonResult evaluate(final String testText, final String... args) { if (args != null && args.length == 1) { return canParse(new SimpleDateFormat(args[0]), testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; } return canParse(testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; } }
IsDateTimePlaceholderHandler implements PlaceholderHandler { @Override public ComparisonResult evaluate(final String testText, final String... args) { if (args != null && args.length == 1) { return canParse(new SimpleDateFormat(args[0]), testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; } return canParse(testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; }  }
IsDateTimePlaceholderHandler implements PlaceholderHandler { @Override public ComparisonResult evaluate(final String testText, final String... args) { if (args != null && args.length == 1) { return canParse(new SimpleDateFormat(args[0]), testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; } return canParse(testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; }  @Override String getKeyword(); @Override ComparisonResult evaluate(final String testText, final String... args); }
IsDateTimePlaceholderHandler implements PlaceholderHandler { @Override public ComparisonResult evaluate(final String testText, final String... args) { if (args != null && args.length == 1) { return canParse(new SimpleDateFormat(args[0]), testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; } return canParse(testText) ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; }  @Override String getKeyword(); @Override ComparisonResult evaluate(final String testText, final String... args);  }