### Question:
WXModalUIModule extends WXSDKEngine.DestroyableModule { @JSMethod(uiThread = true) public void prompt(JSONObject jsObj, final JSCallback callback) { if (mWXSDKInstance.getContext() instanceof Activity) { String message = ""; String defaultValue = ""; String okTitle = OK; String cancelTitle = CANCEL; if (jsObj != null) { try { message = jsObj.getString(MESSAGE); okTitle = jsObj.getString(OK_TITLE); cancelTitle = jsObj.getString(CANCEL_TITLE); defaultValue = jsObj.getString(DEFAULT); } catch (Exception e) { WXLogUtils.e("[WXModalUIModule] confirm param parse error ", e); } } if (TextUtils.isEmpty(message)) { message = ""; } AlertDialog.Builder builder = new AlertDialog.Builder(mWXSDKInstance.getContext()); builder.setMessage(message); final EditText editText = new EditText(mWXSDKInstance.getContext()); editText.setText(defaultValue); builder.setView(editText); final String okTitleFinal = TextUtils.isEmpty(okTitle) ? OK : okTitle; final String cancelTitleFinal = TextUtils.isEmpty(cancelTitle) ? CANCEL : cancelTitle; builder.setPositiveButton(okTitleFinal, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (callback != null) { Map<String, Object> result = new HashMap<String, Object>(); result.put(RESULT, okTitleFinal); result.put(DATA, editText.getText().toString()); callback.invoke(result); } } }).setNegativeButton(cancelTitleFinal, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (callback != null) { Map<String, Object> result = new HashMap<String, Object>(); result.put(RESULT, cancelTitleFinal); result.put(DATA, editText.getText().toString()); callback.invoke(result); } } }); AlertDialog alertDialog = builder.create(); alertDialog.setCanceledOnTouchOutside(false); alertDialog.show(); tracking(alertDialog); } else { WXLogUtils.e("when call prompt mWXSDKInstance.getContext() must instanceof Activity"); } }  @JSMethod(uiThread = true) void toast(JSONObject jsObj); @JSMethod(uiThread = true) void alert(JSONObject jsObj, final JSCallback callback); @JSMethod(uiThread = true) void confirm(JSONObject jsObj, final JSCallback callback); @JSMethod(uiThread = true) void prompt(JSONObject jsObj, final JSCallback callback); @Override void destroy(); static final String OK; static final String CANCEL; static final String RESULT; static final String DATA; static final String MESSAGE; static final String DURATION; static final String OK_TITLE; static final String CANCEL_TITLE; static final String DEFAULT; }### Answer:
@Test public void testPrompt() throws Exception { JSCallback callback = Mockito.mock(JSCallback.class); module.prompt(JSON.parseObject("{}"),callback); }
@Test public void testPrompt() throws Exception { JSCallback callback = Mockito.mock(JSCallback.class); module.prompt("{}",callback); }