@Test
public void testProcessJavascript() throws Exception {

    final String expectedTextWithWhitespace = "\nt;\n";
    Reader reader = new StringReader("goog.provide('id');goog.require('id2'); console.log('hi');" + expectedTextWithWhitespace);
    StringWriter writer = new StringWriter();
    final AddFileUriCommentProcessor processor = new AddFileUriCommentProcessor();
    Resource resource = new Resource();
    resource.setMinimize(true);
    resource.setType(ResourceType.JS);
    resource.setUri("file://dir/file.js");
    processor.process(resource, reader, writer);
    assertTrue(writer.toString().contains(format(AddFileUriCommentProcessor.START_JS_COMMENT, resource.getUri())));
    assertTrue(writer.toString().contains(format(AddFileUriCommentProcessor.END_JS_COMMENT, resource.getUri())));
    assertTrue(writer.toString().contains(expectedTextWithWhitespace));
}