Skip to content

Commit

Permalink
Merge branch 'develop' into feature/event-typed-properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeklim committed Oct 4, 2018
2 parents 6447d2a + d3f769a commit f45b011
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,27 @@ public void pauseGroupPauseTargetResumeGroupResumeTarget() throws Persistence.Pe
channel.resumeGroup(TEST_GROUP, targetToken);
verify(ingestion).sendAsync(anyString(), any(UUID.class), any(LogContainer.class), any(ServiceCallback.class));
}

@Test
public void pauseResumeGroupWhenDisabled() {

/* Create a channel with a log group. */
DefaultChannel channel = spy(new DefaultChannel(mock(Context.class), UUIDUtils.randomUUID().toString(), mock(Persistence.class), mock(AppCenterIngestion.class), mAppCenterHandler));
Channel.Listener listener = mock(Channel.Listener.class);
channel.addListener(listener);

/* Pause group. */
channel.pauseGroup(TEST_GROUP, null);

/* Verify channel doesn't do anything on pause. */
verify(channel, never()).cancelTimer(any(DefaultChannel.GroupState.class));
verify(listener, never()).onPaused(eq(TEST_GROUP), anyString());

/* Resume group. */
channel.resumeGroup(TEST_GROUP, null);

/* Verify channel doesn't do anything on pause. */
verify(channel, never()).checkPendingLogs(eq(TEST_GROUP));
verify(listener, never()).onResumed(eq(TEST_GROUP), anyString());
}
}

0 comments on commit f45b011

Please sign in to comment.