com.google.firebase.auth.UserRecord.CreateRequest doesn't override .equals making it hard to test
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 55/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- java
研究方向
首先定位 com.google.firebase.auth.UserRecord.CreateRequest 與進入點 createUserAsync(CreateRequest request)。檢視現有的驗證測試,然後確認具有相同 payload 的兩個請求是否如預期進行比較,以及基於 Mockito 的測試是否不再收到 null 結果。
由索引模型根據 Issue 內容生成。
描述
[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
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
firebase/firebase-admin-java 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 48/100
firebase/firebase-admin-java#1231 ·
-
api: core
firebase/firebase-admin-java#1198 · 3 則留言 · 已指派 1 人 ·
-
api: remoteconfig
firebase/firebase-admin-java#1196 · 1 則留言 · 已指派 2 人 ·
-
難度 3/5 1-2 天 新手友好度 45/100
firebase/firebase-admin-java#1192 · 3 則留言 ·
-
needs-triage type: feature request
難度 3/5 1-2 天 新手友好度 45/100
firebase/firebase-admin-java#1149 · 1 則留言 ·
查看 firebase/firebase-admin-java 的全部 Issue
相似的 Issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
apache/flink-agents#1152 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 70/100
jenkinsci/blueocean-plugin#5417 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
objectionary/eo-graphs#75 ·