LogOutService { public void attemptLogOut(RapidFtrActivity currentActivity) { if (currentActivity.getContext().getSyncTask() != null) createAlertDialog(currentActivity); else logOut(currentActivity); }  void attemptLogOut(RapidFtrActivity currentActivity);  }
@Test public void shouldUpdateContextOnLogout() throws IOException { application.setSyncTask(null); service.attemptLogOut(activity); verify(application).setCurrentUser(null); }
@Test public void shouldClearCookiesOnLogout() { CookieStore spyCookieStore = spy(FluentRequest.getHttpClient().getCookieStore()); FluentRequest.getHttpClient().setCookieStore(spyCookieStore); service.attemptLogOut(activity); verify(spyCookieStore).clear(); }