NgAnnotateProcessor implements ResourcePreProcessor, ResourcePostProcessor, SupportAware { @Override public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { final OutputStream out = new WriterOutputStream(writer); final InputStream in = new ReaderInputStream(reader); try { doProcess(in, out); } catch (final IOException ex) { final String resourceUri = resource == null ? StringUtils.EMPTY : "[" + resource.getUri() + "]"; LOG.warn("Exception while applying " + getClass().getSimpleName() + " processor on the " + resourceUri + " resource, no processing applied...", ex); throw ex; } }  @Override void process(final Resource resource, final Reader reader, final Writer writer); @Override void process(final Reader reader, final Writer writer); @Override boolean isSupported(); static final String ALIAS; }
@Test public void shouldProcessInvalidJsUnchanged() throws Exception { final String invalidJs = "qwertwi42o"; final StringWriter writer = new StringWriter(); victim.process(new StringReader(invalidJs), writer); assertEquals(invalidJs, writer.toString()); }