@Test
public void shouldStartLoginActivityWhenRequested(){

    when(devicePolicyManager.isAdminActive((ComponentName) anyObject())).thenReturn(true);
    ShadowActivity shadowActivity = shadowOf_(deviceAdminActivity);
    deviceAdminActivity.displayLoginScreen();
    ShadowIntent shadowIntent = shadowOf_(shadowActivity.getNextStartedActivity());
    assertEquals(shadowIntent.getFlags(), Intent.FLAG_ACTIVITY_CLEAR_TOP);
    assertThat(shadowIntent.getComponent().getClassName(), equalTo(LoginActivity_.class.getName()));
}