@Test public void testLogout() throws Exception { Map<MParticle.IdentityType, String> identities = RandomUtils.getInstance().getRandomUserIdentities(); JSONArray identityArray = new JSONArray(); for (Map.Entry<MParticle.IdentityType, String> entry: identities.entrySet()) { identityArray.put(new JSONObject() .put(TYPE, entry.getKey().name()) .put(IDENTITY, entry.getValue())); } JSONObject jsonObject = new JSONObject() .put(USER_IDENTITIES, identityArray); logout(jsonObject.toString()); Mockito.verify(MParticle.getInstance().Identity(), Mockito.times(1)).logout(Mockito.any(IdentityApiRequest.class)); }
@JavascriptInterface public void logout() { MParticle.getInstance().Identity().logout(); }
MParticleJSInterface { @JavascriptInterface public void logout() { MParticle.getInstance().Identity().logout(); } }
MParticleJSInterface { @JavascriptInterface public void logout() { MParticle.getInstance().Identity().logout(); } MParticleJSInterface(); }
MParticleJSInterface { @JavascriptInterface public void logout() { MParticle.getInstance().Identity().logout(); } MParticleJSInterface(); @JavascriptInterface String getCurrentMpId(); @JavascriptInterface void login(); @JavascriptInterface void login(String json); @JavascriptInterface void logout(); @JavascriptInterface void logout(String json); @JavascriptInterface void modify(String json); @JavascriptInterface void logEvent(String json); @JavascriptInterface void setUserTag(String json); @JavascriptInterface void removeUserTag(String json); @JavascriptInterface void setUserAttribute(String json); @JavascriptInterface void removeUserAttribute(String json); @JavascriptInterface void setSessionAttribute(String json); @JavascriptInterface void setUserIdentity(String json); @JavascriptInterface void removeUserIdentity(String json); @JavascriptInterface void addToCart(String json); @JavascriptInterface void removeFromCart(String json); @JavascriptInterface void clearCart(); @JavascriptInterface void setUserAttributeList(String json); @JavascriptInterface void removeAllUserAttributes(); @JavascriptInterface String getUserAttributesLists(); @JavascriptInterface String getAllUserAttributes(); static void registerWebView(WebView webView, String workspaceToken); }
MParticleJSInterface { @JavascriptInterface public void logout() { MParticle.getInstance().Identity().logout(); } MParticleJSInterface(); @JavascriptInterface String getCurrentMpId(); @JavascriptInterface void login(); @JavascriptInterface void login(String json); @JavascriptInterface void logout(); @JavascriptInterface void logout(String json); @JavascriptInterface void modify(String json); @JavascriptInterface void logEvent(String json); @JavascriptInterface void setUserTag(String json); @JavascriptInterface void removeUserTag(String json); @JavascriptInterface void setUserAttribute(String json); @JavascriptInterface void removeUserAttribute(String json); @JavascriptInterface void setSessionAttribute(String json); @JavascriptInterface void setUserIdentity(String json); @JavascriptInterface void removeUserIdentity(String json); @JavascriptInterface void addToCart(String json); @JavascriptInterface void removeFromCart(String json); @JavascriptInterface void clearCart(); @JavascriptInterface void setUserAttributeList(String json); @JavascriptInterface void removeAllUserAttributes(); @JavascriptInterface String getUserAttributesLists(); @JavascriptInterface String getAllUserAttributes(); static void registerWebView(WebView webView, String workspaceToken); static final String INTERFACE_BASE_NAME; }