NgTemplate extends AbstractJavaScriptComponent { @Override public NgTemplateState getState() { return (NgTemplateState) super.getState(); } NgTemplate(String templateSource, String moduleName);  NgTemplate(Package templatePackage, String moduleName);  NgTemplate(File templateFolder, String moduleName); @Override NgTemplateState getState(); void addService(final String name, final Object callback); void setUserState(String key, String value); void setUserState(String key, Object value);  }
@Test public void testConstructorStrings() { NgTemplate template = new NgTemplate("<h1>moin</h1>", "NgTemplateTest") { private static final long serialVersionUID = 1L; }; assertEquals("<h1>moin</h1>", template.getState().templateSource); assertEquals("NgTemplateTest", template.getState().moduleName); }
@Test public void testConstructorPackage() throws UnsupportedEncodingException, URISyntaxException, IOException { NgTemplate template = new NgTemplate(NgTemplateTest.class.getPackage(), "NgTemplateTest") { private static final long serialVersionUID = 1L; }; assertEquals("<h1>heyho</h1>", template.getState().templateSource); assertEquals("NgTemplateTest", template.getState().moduleName); }