// should unconditionally set requestInFlight to false @Test public void testDefaultCallback_successCallsFinishTimelineRequest() { delegate = new TimelineDelegate<>(mockTimeline); final TimelineStateHolder mockHolder = mock(TimelineStateHolder.class); final TimelineDelegate.DefaultCallback cb = delegate.new DefaultCallback(null, mockHolder); cb.success(null); verify(mockHolder).finishTimelineRequest(); }
@Test public void testDefaultCallback_successCallsDeveloperCallback() { final Callback<TimelineResult<TestItem>> developerCb = mock(Callback.class); delegate = new TimelineDelegate<>(mockTimeline); final TimelineDelegate.DefaultCallback cb = delegate.new DefaultCallback(developerCb, delegate.timelineStateHolder); cb.success(testResult); verify(developerCb).success(testResult); }
@Test public void testDefaultCallback_successHandlesNullDeveloperCallback() { delegate = new TimelineDelegate<>(mockTimeline); final TimelineDelegate.DefaultCallback cb = delegate.new DefaultCallback(null, delegate.timelineStateHolder); try { cb.success(testResult); } catch (NullPointerException e) { fail("Should have handled null callback"); } }