@Test public void parseTokenExpirationTimestamp_failed() { try { FirebaseInstallationServiceClient.parseTokenExpirationTimestamp( INCORRECT_EXPIRATION_TIMESTAMP); fail("Parsing token expiration timestamp failed."); } catch (IllegalArgumentException expected) { assertThat(expected) .hasMessageThat() .isEqualTo(FirebaseInstallationServiceClient.PARSING_EXPIRATION_TIME_ERROR_MESSAGE); } }
@VisibleForTesting static long parseTokenExpirationTimestamp(String expiresIn) { checkArgument( EXPIRATION_TIMESTAMP_PATTERN.matcher(expiresIn).matches(), PARSING_EXPIRATION_TIME_ERROR_MESSAGE); return (expiresIn == null || expiresIn.length() == 0) ? 0L : Long.parseLong(expiresIn.substring(0, expiresIn.length() - 1)); }
FirebaseInstallationServiceClient { @VisibleForTesting static long parseTokenExpirationTimestamp(String expiresIn) { checkArgument( EXPIRATION_TIMESTAMP_PATTERN.matcher(expiresIn).matches(), PARSING_EXPIRATION_TIME_ERROR_MESSAGE); return (expiresIn == null || expiresIn.length() == 0) ? 0L : Long.parseLong(expiresIn.substring(0, expiresIn.length() - 1)); } }
FirebaseInstallationServiceClient { @VisibleForTesting static long parseTokenExpirationTimestamp(String expiresIn) { checkArgument( EXPIRATION_TIMESTAMP_PATTERN.matcher(expiresIn).matches(), PARSING_EXPIRATION_TIME_ERROR_MESSAGE); return (expiresIn == null || expiresIn.length() == 0) ? 0L : Long.parseLong(expiresIn.substring(0, expiresIn.length() - 1)); } FirebaseInstallationServiceClient(
      @NonNull Context context,
      @NonNull Provider<UserAgentPublisher> publisher,
      @NonNull Provider<HeartBeatInfo> heartbeatInfo); }
FirebaseInstallationServiceClient { @VisibleForTesting static long parseTokenExpirationTimestamp(String expiresIn) { checkArgument( EXPIRATION_TIMESTAMP_PATTERN.matcher(expiresIn).matches(), PARSING_EXPIRATION_TIME_ERROR_MESSAGE); return (expiresIn == null || expiresIn.length() == 0) ? 0L : Long.parseLong(expiresIn.substring(0, expiresIn.length() - 1)); } FirebaseInstallationServiceClient(
      @NonNull Context context,
      @NonNull Provider<UserAgentPublisher> publisher,
      @NonNull Provider<HeartBeatInfo> heartbeatInfo); @NonNull InstallationResponse createFirebaseInstallation(
      @NonNull String apiKey,
      @Nullable String fid,
      @NonNull String projectID,
      @NonNull String appId,
      @Nullable String iidToken); @NonNull void deleteFirebaseInstallation(
      @NonNull String apiKey,
      @NonNull String fid,
      @NonNull String projectID,
      @NonNull String refreshToken); @NonNull TokenResult generateAuthToken(
      @NonNull String apiKey,
      @NonNull String fid,
      @NonNull String projectID,
      @NonNull String refreshToken); }
FirebaseInstallationServiceClient { @VisibleForTesting static long parseTokenExpirationTimestamp(String expiresIn) { checkArgument( EXPIRATION_TIMESTAMP_PATTERN.matcher(expiresIn).matches(), PARSING_EXPIRATION_TIME_ERROR_MESSAGE); return (expiresIn == null || expiresIn.length() == 0) ? 0L : Long.parseLong(expiresIn.substring(0, expiresIn.length() - 1)); } FirebaseInstallationServiceClient(
      @NonNull Context context,
      @NonNull Provider<UserAgentPublisher> publisher,
      @NonNull Provider<HeartBeatInfo> heartbeatInfo); @NonNull InstallationResponse createFirebaseInstallation(
      @NonNull String apiKey,
      @Nullable String fid,
      @NonNull String projectID,
      @NonNull String appId,
      @Nullable String iidToken); @NonNull void deleteFirebaseInstallation(
      @NonNull String apiKey,
      @NonNull String fid,
      @NonNull String projectID,
      @NonNull String refreshToken); @NonNull TokenResult generateAuthToken(
      @NonNull String apiKey,
      @NonNull String fid,
      @NonNull String projectID,
      @NonNull String refreshToken);  }