@Test public void testIfDetectMimeTypeRouteToNorthPole() throws Exception { Context context = new Context(); context.put(MorphlineHandlerImpl.MORPHLINE_FILE_PARAM, RESOURCES_DIR + "/test-morphlines/ifDetectMimeType.conf"); context.put(MorphlineHandlerImpl.MORPHLINE_VARIABLE_PARAM + ".MY.MIME_TYPE", "avro/binary"); Event input = EventBuilder.withBody(Files.toByteArray(new File(RESOURCES_DIR + "/test-documents/testPDF.pdf"))); Event actual = build(context).intercept(input); Map<String, String> expected = new HashMap(); expected.put(Fields.ATTACHMENT_MIME_TYPE, "application/pdf"); expected.put("flume.selector.header", "goToNorthPole"); Event expectedEvent = EventBuilder.withBody(input.getBody(), expected); assertEqualsEvent(expectedEvent, actual); }
@Override public List<Event> intercept(List<Event> events) { LocalMorphlineInterceptor interceptor = borrowFromPool(); List<Event> results = interceptor.intercept(events); returnToPool(interceptor); return results; }
MorphlineInterceptor implements Interceptor { @Override public List<Event> intercept(List<Event> events) { LocalMorphlineInterceptor interceptor = borrowFromPool(); List<Event> results = interceptor.intercept(events); returnToPool(interceptor); return results; } }
MorphlineInterceptor implements Interceptor { @Override public List<Event> intercept(List<Event> events) { LocalMorphlineInterceptor interceptor = borrowFromPool(); List<Event> results = interceptor.intercept(events); returnToPool(interceptor); return results; } protected  MorphlineInterceptor(Context context); }
MorphlineInterceptor implements Interceptor { @Override public List<Event> intercept(List<Event> events) { LocalMorphlineInterceptor interceptor = borrowFromPool(); List<Event> results = interceptor.intercept(events); returnToPool(interceptor); return results; } protected  MorphlineInterceptor(Context context); @Override void initialize(); @Override void close(); @Override List<Event> intercept(List<Event> events); @Override Event intercept(Event event); }
MorphlineInterceptor implements Interceptor { @Override public List<Event> intercept(List<Event> events) { LocalMorphlineInterceptor interceptor = borrowFromPool(); List<Event> results = interceptor.intercept(events); returnToPool(interceptor); return results; } protected  MorphlineInterceptor(Context context); @Override void initialize(); @Override void close(); @Override List<Event> intercept(List<Event> events); @Override Event intercept(Event event);  }