@Test public void testInvokeJavascript() { String arg = "myArg"; Object[] argArray = new Object[] {arg}; String function = "myFunction"; String result = "result"; when(mockJsObject.call(function, argArray)).thenReturn(result); Object returnValue = testJavascriptObject.invokeJavascript(function, arg); assertEquals( result, returnValue ); }
protected Object invokeJavascript(String function) { return checkUndefined(jsObject.call(function)); }
JavascriptObject { protected Object invokeJavascript(String function) { return checkUndefined(jsObject.call(function)); } }
JavascriptObject { protected Object invokeJavascript(String function) { return checkUndefined(jsObject.call(function)); } protected  JavascriptObject(); protected  JavascriptObject(String type); protected  JavascriptObject( String type, String stringRepresentation ); protected  JavascriptObject(String type, Object... args); protected  JavascriptObject(String type, Object[] ary, boolean isArray); protected  JavascriptObject(String type, JSObject jsObject); }
JavascriptObject { protected Object invokeJavascript(String function) { return checkUndefined(jsObject.call(function)); } protected  JavascriptObject(); protected  JavascriptObject(String type); protected  JavascriptObject( String type, String stringRepresentation ); protected  JavascriptObject(String type, Object... args); protected  JavascriptObject(String type, Object[] ary, boolean isArray); protected  JavascriptObject(String type, JSObject jsObject); JSObject getJSObject(); String getVariableName(); }
JavascriptObject { protected Object invokeJavascript(String function) { return checkUndefined(jsObject.call(function)); } protected  JavascriptObject(); protected  JavascriptObject(String type); protected  JavascriptObject( String type, String stringRepresentation ); protected  JavascriptObject(String type, Object... args); protected  JavascriptObject(String type, Object[] ary, boolean isArray); protected  JavascriptObject(String type, JSObject jsObject); JSObject getJSObject(); String getVariableName();  }