@Test public void testGetEventReader() { PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader = Mockito.mock(PipelineEventReaderImpl.class); CharacterEventReader eventReader = Mockito.mock(CharacterEventReader.class); Mockito.when(pipelineEventReader.getEventReader()).thenReturn(eventReader); Mockito.when(wrappedComponent.getEventReader(req, res)).thenReturn(pipelineEventReader); jsonWrapperFilteringCharacterPipelineComponent.setWrappedComponent(wrappedComponent); jsonWrapperFilteringCharacterPipelineComponent.getEventReader(req, res); Mockito.verify(wrappedComponent).getEventReader(req, res); }
@Override public PipelineEventReader<CharacterEventReader, CharacterEvent> getEventReader( HttpServletRequest request, HttpServletResponse response) throws IllegalStateException { if (this.wrappedComponent != null) { final PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader = this.wrappedComponent.getEventReader(request, response); final CharacterEventReader eventReader = pipelineEventReader.getEventReader(); final JsonWrapperFilteringCharacterEventReader jsonWrapperFilteringCharacterEventReader = new JsonWrapperFilteringCharacterEventReader(eventReader); final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties(); return new PipelineEventReaderImpl<CharacterEventReader, CharacterEvent>( jsonWrapperFilteringCharacterEventReader, outputProperties); } else { logger.warn("PipelineComponentWrapper.wrapperComponent is null"); throw new IllegalStateException("PipelineComponentWrapper.wrapperComponent is null"); } }
JsonWrapperFilteringCharacterPipelineComponent extends CharacterPipelineComponentWrapper { @Override public PipelineEventReader<CharacterEventReader, CharacterEvent> getEventReader( HttpServletRequest request, HttpServletResponse response) throws IllegalStateException { if (this.wrappedComponent != null) { final PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader = this.wrappedComponent.getEventReader(request, response); final CharacterEventReader eventReader = pipelineEventReader.getEventReader(); final JsonWrapperFilteringCharacterEventReader jsonWrapperFilteringCharacterEventReader = new JsonWrapperFilteringCharacterEventReader(eventReader); final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties(); return new PipelineEventReaderImpl<CharacterEventReader, CharacterEvent>( jsonWrapperFilteringCharacterEventReader, outputProperties); } else { logger.warn("PipelineComponentWrapper.wrapperComponent is null"); throw new IllegalStateException("PipelineComponentWrapper.wrapperComponent is null"); } } }
JsonWrapperFilteringCharacterPipelineComponent extends CharacterPipelineComponentWrapper { @Override public PipelineEventReader<CharacterEventReader, CharacterEvent> getEventReader( HttpServletRequest request, HttpServletResponse response) throws IllegalStateException { if (this.wrappedComponent != null) { final PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader = this.wrappedComponent.getEventReader(request, response); final CharacterEventReader eventReader = pipelineEventReader.getEventReader(); final JsonWrapperFilteringCharacterEventReader jsonWrapperFilteringCharacterEventReader = new JsonWrapperFilteringCharacterEventReader(eventReader); final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties(); return new PipelineEventReaderImpl<CharacterEventReader, CharacterEvent>( jsonWrapperFilteringCharacterEventReader, outputProperties); } else { logger.warn("PipelineComponentWrapper.wrapperComponent is null"); throw new IllegalStateException("PipelineComponentWrapper.wrapperComponent is null"); } }  }
JsonWrapperFilteringCharacterPipelineComponent extends CharacterPipelineComponentWrapper { @Override public PipelineEventReader<CharacterEventReader, CharacterEvent> getEventReader( HttpServletRequest request, HttpServletResponse response) throws IllegalStateException { if (this.wrappedComponent != null) { final PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader = this.wrappedComponent.getEventReader(request, response); final CharacterEventReader eventReader = pipelineEventReader.getEventReader(); final JsonWrapperFilteringCharacterEventReader jsonWrapperFilteringCharacterEventReader = new JsonWrapperFilteringCharacterEventReader(eventReader); final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties(); return new PipelineEventReaderImpl<CharacterEventReader, CharacterEvent>( jsonWrapperFilteringCharacterEventReader, outputProperties); } else { logger.warn("PipelineComponentWrapper.wrapperComponent is null"); throw new IllegalStateException("PipelineComponentWrapper.wrapperComponent is null"); } }  @Override CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response); @Override PipelineEventReader<CharacterEventReader, CharacterEvent> getEventReader(
            HttpServletRequest request, HttpServletResponse response); }
JsonWrapperFilteringCharacterPipelineComponent extends CharacterPipelineComponentWrapper { @Override public PipelineEventReader<CharacterEventReader, CharacterEvent> getEventReader( HttpServletRequest request, HttpServletResponse response) throws IllegalStateException { if (this.wrappedComponent != null) { final PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader = this.wrappedComponent.getEventReader(request, response); final CharacterEventReader eventReader = pipelineEventReader.getEventReader(); final JsonWrapperFilteringCharacterEventReader jsonWrapperFilteringCharacterEventReader = new JsonWrapperFilteringCharacterEventReader(eventReader); final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties(); return new PipelineEventReaderImpl<CharacterEventReader, CharacterEvent>( jsonWrapperFilteringCharacterEventReader, outputProperties); } else { logger.warn("PipelineComponentWrapper.wrapperComponent is null"); throw new IllegalStateException("PipelineComponentWrapper.wrapperComponent is null"); } }  @Override CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response); @Override PipelineEventReader<CharacterEventReader, CharacterEvent> getEventReader(
            HttpServletRequest request, HttpServletResponse response);  }