Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

com.google.firebase.auth.UserRecord.CreateRequest doesn't override .equals making it hard to test

未關閉
#600 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
java

研究方向

首先定位 com.google.firebase.auth.UserRecord.CreateRequest 與進入點 createUserAsync(CreateRequest request)。檢視現有的驗證測試,然後確認具有相同 payload 的兩個請求是否如預期進行比較,以及基於 Mockito 的測試是否不再收到 null 結果。

由索引模型根據 Issue 內容生成。

描述

help wanted needs-triage type: feature request
[READ] Step 1: Are you in the right place?
  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request make sure the issue title starts with "FR:".
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.
[REQUIRED] Step 2: Describe your environment
  • Operating System version: _____
  • Firebase SDK version: _____
  • Library version: _____
  • Firebase Product: _____ (auth, database, storage, etc)
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Relevant Code:
// TODO(you): code here to reproduce the problem

I built an application with a function that call firebaseAuth.createUserAsync(CreateRequest request). To test the logic in this function, I created a unit test for it with a mock:

CreateRequest createRequest = // creates some request
UserRecord userRecord = // build a record

FirebaseAuth auth = mock(FirebaseAuth.class);
when(auth.createUserAsync(createRequest)).thenReturn(ApiFutures.immediateFuture(userRecord))

but when I ran the test I got a Null Pointer Exception from Mockito. On further inspection, I realized that two instances of CreateRequest with the same payload value return false when compared via .equals. This leads Mockito to think the function is not defined for this argument.

I am happy to contribute this simple (probably IntelliJ-generated) code, is there a reason you don't want this in there?

主要語言
Java
星號
620
分支
305
平均合併
4 天 9 小時
30 天內合併 PR
4

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

firebase/firebase-admin-java 的其他 Issue

查看 firebase/firebase-admin-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。