@Test
public void when_auth_token_is_required_and_token_is_present() throws Exception {

  when(data.isAccessTokenRequired()).thenReturn(true);
  long thirtyMinutesFromNow = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(30);
  when(data.tokenExpiryTimeMillis()).thenReturn(Single.just(thirtyMinutesFromNow));
  when(data.accessToken()).thenReturn(Single.just(AUTH_TOKEN));
  GfycatResponse response = GfycatResponse.create(GFYCAT_RESPONSE);
  when(dankApi.gfycat(AUTH_TOKEN, UNRESOLVED_ID)).thenReturn(Single.just(response));
  gfycatRepository.gif(UNRESOLVED_ID)
      .test()
      .assertNoErrors()
      .assertComplete()
      .assertValue(GFYCAT_RESOLVED_LINK);
}