Quantcast
Channel: JDriven Blog » Mockito
Browsing all 6 articles
Browse latest View live

Tasty Test Tip: Using ArgumentCaptor for generic collections with Mockito

Mockito has a very nice feature that allows you to verify what parameters were used when a method was executed. For example: [crayon-514c9028b58a8/] However, when using generic typed objects, some...

View Article



Tasty Test Tip: Test final and static methods with PowerMock and Mockito

Two of the most famous mocking frameworks EasyMock and Mockito, don’t offer out of the box support for mocking final and static methods. It is often said on forums that “you don’t want that” or “your...

View Article

Using ArgumentMatchers with Mockito

Mockito is a mock framework which you can use to write simple and clean tests. One of it’s nice features is the ArgumentMatcher. With the ArgumentMatcher you can determine the outcome of your mocked...

View Article

Mock a superclass method with Mockito

Say you want to test a method from class which extends some kind of superclass. Sometimes you can be dependent on code in the superclass, which is undesirable in a test. Now actually, the first thing...

View Article

Using ArgumentMatchers with Mockito

Mockito is a mock framework which you can use to write simple and clean tests. One of it’s nice features is the ArgumentMatcher. With the ArgumentMatcher you can determine the outcome of your mocked...

View Article


Tasty Test Tip: Matching generic typed classes in Mockito

Say you have a arbitrary class under test, which is dependent on a class DataProcessor which has a method with the following signature: [crayon-51e60adf28f7f/] you might want to stub it with Mockito...

View Article
Browsing all 6 articles
Browse latest View live




Latest Images