/** Activate the live activity from a group without a startup. */ @Test public void groupActivityActivate() { activeLiveActivity.activateFromLiveActivityGroup(activeLiveActivityGroup1); assertActiveActivityState( activeLiveActivity, false, 1, false, 1, ActivityState.ACTIVATE_ATTEMPT, ActivityState.UNKNOWN); Mockito.verify(remoteControllerClient, Mockito.times(0)).startupActivity(activeLiveActivity); Mockito.verify(remoteControllerClient, Mockito.times(1)).activateActivity(activeLiveActivity); }
/** Activate the live activity from two groups without a startup, then deactivate from both. */ @Test public void groupTwoActivityActivateAndTwoDeactivate() { activeLiveActivity.activateFromLiveActivityGroup(activeLiveActivityGroup1); activeLiveActivity.activateFromLiveActivityGroup(activeLiveActivityGroup2); activeLiveActivity.deactivateFromLiveActivityGroup(activeLiveActivityGroup1); activeLiveActivity.deactivateFromLiveActivityGroup(activeLiveActivityGroup2); assertActiveActivityState( activeLiveActivity, false, 2, false, 0, ActivityState.DEACTIVATE_ATTEMPT, ActivityState.UNKNOWN); Mockito.verify(remoteControllerClient, Mockito.times(1)).deactivateActivity(activeLiveActivity); }
/** Activate the live activity from a group, then shut it down from a group. */ @Test public void groupActivityActivateAndShutdown() { activeLiveActivity.activateFromLiveActivityGroup(activeLiveActivityGroup1); assertActiveActivityState( activeLiveActivity, false, 1, false, 1, ActivityState.ACTIVATE_ATTEMPT, ActivityState.UNKNOWN); activeLiveActivity.shutdownFromLiveActivityGroup(activeLiveActivityGroup1); assertActiveActivityState( activeLiveActivity, false, 0, false, 0, ActivityState.SHUTDOWN_ATTEMPT, ActivityState.UNKNOWN); }