@Test public void testAll() throws Exception { final Interceptor removeHeaderInterceptor = new RemoveHeaderIntBuilder() .matchRegex("my-header2.*") .fromList(HEADER1 + MY_SEPARATOR + HEADER3, MY_SEPARATOR) .withName(HEADER2).build(); final Event event1 = buildEventWithHeader(); Assert.assertEquals(HEADER1, event1.getHeaders().get(HEADER1)); Assert.assertEquals(HEADER2, event1.getHeaders().get(HEADER2)); Assert.assertEquals(HEADER3, event1.getHeaders().get(HEADER3)); Assert.assertEquals(HEADER4, event1.getHeaders().get(HEADER4)); Assert.assertEquals(HEADER5, event1.getHeaders().get(HEADER5)); removeHeaderInterceptor.intercept(event1); Assert.assertTrue(event1.getHeaders().isEmpty()); final Event event2 = buildEventWithoutHeader(); Assert.assertTrue(event2.getHeaders().isEmpty()); removeHeaderInterceptor.intercept(event2); Assert.assertTrue(event2.getHeaders().isEmpty()); }
@Override public List<Event> intercept(final List<Event> events) { for (final Event event : events) { intercept(event); } return events; }
RemoveHeaderInterceptor implements Interceptor { @Override public List<Event> intercept(final List<Event> events) { for (final Event event : events) { intercept(event); } return events; } }
RemoveHeaderInterceptor implements Interceptor { @Override public List<Event> intercept(final List<Event> events) { for (final Event event : events) { intercept(event); } return events; } private  RemoveHeaderInterceptor(final String withName, final String fromList,
                                  final String listSeparator, final Pattern matchRegex); }
RemoveHeaderInterceptor implements Interceptor { @Override public List<Event> intercept(final List<Event> events) { for (final Event event : events) { intercept(event); } return events; } private  RemoveHeaderInterceptor(final String withName, final String fromList,
                                  final String listSeparator, final Pattern matchRegex); @Override void initialize(); @Override void close(); @Override List<Event> intercept(final List<Event> events); @Override Event intercept(final Event event); }
RemoveHeaderInterceptor implements Interceptor { @Override public List<Event> intercept(final List<Event> events) { for (final Event event : events) { intercept(event); } return events; } private  RemoveHeaderInterceptor(final String withName, final String fromList,
                                  final String listSeparator, final Pattern matchRegex); @Override void initialize(); @Override void close(); @Override List<Event> intercept(final List<Event> events); @Override Event intercept(final Event event);  }