### Question:
WXModalUIModule extends WXSDKEngine.DestroyableModule { @JSMethod(uiThread = true) public void toast(JSONObject jsObj) { if(mWXSDKInstance.getContext() == null){ return; } String message = ""; int duration = Toast.LENGTH_SHORT; if (jsObj != null) { try { message = jsObj.getString(MESSAGE); if(jsObj.containsKey(DURATION)) { duration = jsObj.getInteger(DURATION); } } catch (Exception e) { WXLogUtils.e("[WXModalUIModule] alert param parse error ", e); } } if (TextUtils.isEmpty(message)) { WXLogUtils.e("[WXModalUIModule] toast param parse is null "); return; } if (duration > 3) { duration = Toast.LENGTH_LONG; } else { duration = Toast.LENGTH_SHORT; } if (toast == null) { toast = Toast.makeText(mWXSDKInstance.getContext(), message, duration); } else { toast.setDuration(duration); toast.setText(message); } toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); }  @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 testToast() throws Exception { module.toast("{}"); }