@Test public void testGetAuthHeader() { String header = mAuthController.getAuthHeader(); assertEquals(header, "Bearer abc123"); }
@WorkerThread public @Nullable String getAuthHeader() { try { String token = getGoogleAuthToken(); if (token == null) { return null; } return String.format(AUTH_HEADER_FORMAT, token); } catch (InterruptedException | ExecutionException e) { TbaLogger.w("Auth exception while fetching google token", e); return null; } }
GceAuthController { @WorkerThread public @Nullable String getAuthHeader() { try { String token = getGoogleAuthToken(); if (token == null) { return null; } return String.format(AUTH_HEADER_FORMAT, token); } catch (InterruptedException | ExecutionException e) { TbaLogger.w("Auth exception while fetching google token", e); return null; } } }
GceAuthController { @WorkerThread public @Nullable String getAuthHeader() { try { String token = getGoogleAuthToken(); if (token == null) { return null; } return String.format(AUTH_HEADER_FORMAT, token); } catch (InterruptedException | ExecutionException e) { TbaLogger.w("Auth exception while fetching google token", e); return null; } } @Inject  GceAuthController(FirebaseAuthProvider firebaseAuth); }
GceAuthController { @WorkerThread public @Nullable String getAuthHeader() { try { String token = getGoogleAuthToken(); if (token == null) { return null; } return String.format(AUTH_HEADER_FORMAT, token); } catch (InterruptedException | ExecutionException e) { TbaLogger.w("Auth exception while fetching google token", e); return null; } } @Inject  GceAuthController(FirebaseAuthProvider firebaseAuth); @WorkerThread @Nullable String getAuthHeader(); }
GceAuthController { @WorkerThread public @Nullable String getAuthHeader() { try { String token = getGoogleAuthToken(); if (token == null) { return null; } return String.format(AUTH_HEADER_FORMAT, token); } catch (InterruptedException | ExecutionException e) { TbaLogger.w("Auth exception while fetching google token", e); return null; } } @Inject  GceAuthController(FirebaseAuthProvider firebaseAuth); @WorkerThread @Nullable String getAuthHeader();  }