@Test
public void shouldFinishActivityOnLogout() throws IOException {

    RapidFtrApplication instance = RapidFtrApplication.getApplicationInstance();
    instance.setCurrentUser(createUser());
    RapidFtrActivity loginActivity = new LoginActivity_();
    MenuItem menuItem = mock(MenuItem.class);
    given(menuItem.getItemId()).willReturn(R.id.logout);
    loginActivity.onOptionsItemSelected(menuItem);
    assertThat(loginActivity.isFinishing(), is(true));
}