@Test
public void shouldExtractAddHeadersUsingSpecifiedSerializer()
    throws Exception {

  long now = (System.currentTimeMillis() / 60000L) * 60000L;
  String pattern = "yyyy-MM-dd HH:mm:ss,SSS";
  DateTimeFormatter formatter = DateTimeFormat.forPattern(pattern);
  String body = formatter.print(now);
  System.out.println(body);
  Context context = new Context();
  // Skip the second group
  context.put(RegexExtractorInterceptor.REGEX,
      "^(\\d\\d\\d\\d-\\d\\d-\\d\\d\\s\\d\\d:\\d\\d)(:\\d\\d,\\d\\d\\d)");
  context.put(RegexExtractorInterceptor.SERIALIZERS, "s1 s2");
  String millisSerializers = RegexExtractorInterceptorMillisSerializer.class.getName();
  context.put(RegexExtractorInterceptor.SERIALIZERS + ".s1.type", millisSerializers);
  context.put(RegexExtractorInterceptor.SERIALIZERS + ".s1.name", "timestamp");
  context.put(RegexExtractorInterceptor.SERIALIZERS + ".s1.pattern", "yyyy-MM-dd HH:mm");
  // Default type
  context.put(RegexExtractorInterceptor.SERIALIZERS + ".s2.name", "data");
  fixtureBuilder.configure(context);
  Interceptor fixture = fixtureBuilder.build();
  Event event = EventBuilder.withBody(body, Charsets.UTF_8);
  Event expected = EventBuilder.withBody(body, Charsets.UTF_8);
  expected.getHeaders().put("timestamp", String.valueOf(now));
  expected.getHeaders().put("data", ":00,000");
  Event actual = fixture.intercept(event);
  Assert.assertArrayEquals(expected.getBody(), actual.getBody());
  Assert.assertEquals(expected.getHeaders(), actual.getHeaders());
}