mockito の説明、意味不明なところがある

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
java

Research direction

Start by locating the quoted Mockito explanation in the handbook, then inspect the linked DefaultAnswer and SmartNulls implementation references. Clarify the distinction between empty standard collections and ReturnsSmartNulls; the work is done when the passage is understandable and consistent with the referenced behavior.

Written by the indexing model from the issue text.

Description

[3:09 PM] dayflower:
    |  JDK で提供されているコンテナ型の場合には空のコンテナ型が返りますのでいいのですが
[3:09 PM] dayflower: いまいちここがよくわからなかった
[3:13 PM] Tokuhiro Matsuno: それは
[3:13 PM] Tokuhiro Matsuno: 意味不明ですね
[3:14 PM] Tokuhiro Matsuno: Java が提供している標準のコンテナ(List, Set など)の場合には空の値が返ります
[3:14 PM] Tokuhiro Matsuno: empty の list など
[3:14 PM] dayflower: あー
[3:14 PM] dayflower: そこは検知しようがないですか?
[3:14 PM] dayflower: stub し忘れの
[3:15 PM] Tokuhiro Matsuno: いや、それをやるのが
[3:15 PM] dayflower: ReturnsSmartNulls っすか?
[3:15 PM] Tokuhiro Matsuno: https://github.com/mockito/mockito/blob/master/src/main/java/org/mockito/configuration/DefaultMockit...
[3:15 PM] Tokuhiro Matsuno: デフォルトの
[3:15 PM] Tokuhiro Matsuno: はい
[3:15 PM] dayflower: なんか空Listが帰ってきた気がするな
[3:15 PM] Tokuhiro Matsuno: なので、 getDefaultAnswer 書き換えれば挙動変わるはず
[3:16 PM] Tokuhiro Matsuno: https://github.com/mockito/mockito/blob/master/src/main/java/org/mockito/internal/stubbing/defaultan...
[3:16 PM] Tokuhiro Matsuno: このへんが実装
[3:17 PM] dayflower: こっちが smartnulls か https://github.com/mockito/mockito/blob/master/src/main/java/org/mockito/internal/stubbing/defaultan...
[3:18 PM] Tokuhiro Matsuno: んむ
Dominant language
Java
Stars
146
Forks
9
Avg merge
2m
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tokuhirom/java-handbook

All issues in tokuhirom/java-handbook

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.