差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
java:junit:powermock [2020/04/25 18:29] tony [Mockito / PowerMockito] |
java:junit:powermock [2021/02/15 15:18] tony [Mockito / PowerMockito] |
||
---|---|---|---|
行 25: | 行 25: | ||
* [[.:mockito:mutiple_value_answer|Answer Contains Multiple Value]] | * [[.:mockito:mutiple_value_answer|Answer Contains Multiple Value]] | ||
* [[.:powermockito:code_coverage_with_powermock_on_static_method|Code Coverage With PowerMock on static method]] | * [[.:powermockito:code_coverage_with_powermock_on_static_method|Code Coverage With PowerMock on static method]] | ||
- | ===== Note ===== | + | * [[.:mockito:annotations|Mockito with annotations]] |
- | * 使用createPartialMock後,必須用PowerMock.replayAll(),PowerMock.replay(XXX.class)是無效的。 | + | |
- | * andReturn與andStubReturn差別為何? | + | |
- | * 有預設值的data member在mock後變為null該怎辦? | + | |
- | * 如果有一個mock class A,會被class B透過Adapter的使用方式。必須將class B加入到@PrepareForTest中。 | + | |
===== Resource ===== | ===== Resource ===== | ||
* [[http://code.google.com/p/powermock/|PowerMock Official Site]] | * [[http://code.google.com/p/powermock/|PowerMock Official Site]] | ||
行 38: | 行 35: | ||
* [[http://easymock.org/user-guide.html#mocking-partial|Partial mocking is bad design]] | * [[http://easymock.org/user-guide.html#mocking-partial|Partial mocking is bad design]] | ||
* [[http://blog.tremblay.pro/2015/02/the-history-of-partial-mocking.html|The history of partial mocking]] | * [[http://blog.tremblay.pro/2015/02/the-history-of-partial-mocking.html|The history of partial mocking]] | ||
+ | * [[https://www.baeldung.com/mockito-annotations|Getting Started with Mockito @Mock, @Spy, @Captor and @InjectMocks]] | ||
===== ===== | ===== ===== |