@Test public void testRenderHead_resource() throws Exception { JavaScriptDependency dep = new MockedJavaScriptDependency(getClass(), "file.js"); DependencyCollection expected = new DependencyCollection(); expected.add(this.script1); this.locator.setResourceScripts(expected); dep.renderHead(null, this.response); verify(this.response).renderJavaScriptReference(this.script1); verifyNoMoreInteractions(this.response); }
@Test public void testRenderHead_library() throws Exception { JavaScriptDependency dep = new MockedJavaScriptDependency("library"); DependencyCollection expected = new DependencyCollection(); expected.setCss(this.css); expected.add(this.script1); expected.add(this.script2); expected.add(this.script3); this.locator.setLibraryScripts(expected); dep.renderHead(null, this.response); verify(this.response).renderCSSReference(this.css); InOrder inOrder = inOrder(this.response); inOrder.verify(this.response).renderJavaScriptReference(this.script1); inOrder.verify(this.response).renderJavaScriptReference(this.script2); inOrder.verify(this.response).renderJavaScriptReference(this.script3); verifyNoMoreInteractions(this.response); }