AppStateManager { public void endSession() { Logger.debug("Ended session"); mMessageManager.endSession(mCurrentSession); disableLocationTracking(); mCurrentSession = new InternalSession(); if (MParticle.getInstance() != null) { MParticle.getInstance().Internal().getKitManager().onSessionEnd(); } InternalListenerManager.getListener().onSessionUpdated(mCurrentSession); } AppStateManager(Context context, boolean unitTesting);  AppStateManager(Context context); void init(int apiVersion); String getLaunchAction(); Uri getLaunchUri(); void setConfigManager(ConfigManager manager); void setMessageManager(MessageManager manager); void onActivityResumed(Activity activity); void onActivityPaused(Activity activity); void ensureActiveSession(); void logStateTransition(String transitionType, String currentActivity); void onActivityCreated(Activity activity, Bundle savedInstanceState); void onActivityStarted(Activity activity); void onActivityStopped(Activity activity); boolean isBackgrounded(); String getCurrentActivityName(); InternalSession getSession(); void endSession(); void startSession(); void onActivitySaveInstanceState(Activity activity, Bundle outState); void onActivityDestroyed(Activity activity); WeakReference<Activity> getCurrentActivity(); static boolean mInitialized; static final String APP_STATE_FOREGROUND; static final String APP_STATE_BACKGROUND; static final String APP_STATE_NOTRUNNING; }
@Test public void testEndSession() throws Exception { manager.startSession(); manager.endSession(); assertTrue(manager.getSession().mSessionID.equals("NO-SESSION")); }