RegexExtractorInterceptorMillisSerializer implements
    RegexExtractorInterceptorSerializer { @Override public void configure(Context context) { String pattern = context.getString("pattern"); Preconditions.checkArgument(!StringUtils.isEmpty(pattern), "Must configure with a valid pattern"); formatter = DateTimeFormat.forPattern(pattern); }  @Override void configure(Context context); @Override String serialize(String value); @Override void configure(ComponentConfiguration conf);  }
@Test public void shouldRequirePatternInConfiguration() { try { RegexExtractorInterceptorMillisSerializer fixture = new RegexExtractorInterceptorMillisSerializer(); fixture.configure(new Context()); Assert.fail(); } catch (IllegalArgumentException ex) { } }
@Test public void shouldRequireValidPatternInConfiguration() { try { RegexExtractorInterceptorMillisSerializer fixture = new RegexExtractorInterceptorMillisSerializer(); Context context = new Context(); context.put("pattern", "ABCDEFG"); fixture.configure(context); Assert.fail(); } catch (IllegalArgumentException ex) { } }