### Question:
DomReadyTemplate extends AbstractJavaScriptContribution { @Override public void renderHead(Component comp, IHeaderResponse response) { if(null == this.dependencies) load(comp); renderDependencies(response, this.dependencies, this.template); renderDomReady(response, this.readyScript); } DomReadyTemplate(Class<?> templateLocation); protected  DomReadyTemplate(); @Override void bind(Component component); @Override void detach(Component component); @Override void renderHead(Component comp, IHeaderResponse response);  }### Answer:
@Test public void testExceptionThrownWhenNoTemplateFound() { DomReadyTemplate tmpl = new DomReadyTemplate(DomReadyTemplateTest.class); try { tmpl.renderHead(null, this.response); Assert.fail("Did not throw exception as expected."); } catch(WicketRuntimeException wre) { Assert.assertTrue(wre.getMessage().startsWith("Failed to locate JavaScript template")); } }