IFrame extends HtmlComponent { public void reload() { getElement().executeJs("this.src = this.src"); } IFrame();  IFrame(String src); void setSrc(String src); String getSrc(); void setSrcdoc(String srcdoc); Optional<String> getSrcdoc(); void setAllow(String allow); Optional<String> getAllow(); void setName(String name); Optional<String> getName(); void setImportance(ImportanceType importance); Optional<ImportanceType> getImportance(); void setSandbox(SandboxType ...types); Optional<SandboxType[]> getSandbox(); void reload();  }
@Test public void reload() throws Exception { Element element = Mockito.mock(Element.class); IFrame iframe = new IFrame(); Field f = Component.class.getDeclaredField("element"); f.setAccessible(true); f.set(iframe, element); iframe.reload(); Mockito.verify(element).executeJs("this.src = this.src"); }