RideRequestView extends LinearLayout { @NonNull @VisibleForTesting static Map<String, String> getHeaders(@NonNull AccessToken accessToken) { final String AUTH_HEADER = "Authorization"; final String BEARER = "Bearer"; Map<String, String> headers = new HashMap<String, String>(); headers.put(AUTH_HEADER, BEARER + " " + accessToken.getToken()); return headers; } RideRequestView(Context context);  RideRequestView(Context context, AttributeSet attrs); void cancelLoad(); @Nullable AccessTokenSession getSession(); void load(); void setSession(@Nullable AccessTokenSession accessTokenSession); void setRideParameters(@NonNull RideParameters rideParameters); void setRideRequestViewCallback(@NonNull RideRequestViewCallback rideRequestViewCallback);  }
@Test public void onGetHeaders_withAccessToken_shouldReturnCorrectHeader() { String token = "accessToken123"; AccessToken accessToken = new AccessToken(2592000, ImmutableList.of(Scope.HISTORY), token, "refreshToken", "tokenType"); Map<String, String> headers = RideRequestView.getHeaders(accessToken); assertEquals(headers.size(), 1); assertEquals(headers.get("Authorization"), "Bearer " + token); }