Tags » Mockito

Why I spy

Spy is a mocking concept used to mock/stub parts of a class (“partial mocking”).
Should we use it? And if so, when?

From one perspective, gazing from an… 296 more words

Junit

Mock Unit Testing using Mockito in Play Scala project

During Unit Testing in a Play Scala project, there arises a need to Mock certain Objects or Traits which are used in the unit, so that the unit being tested has a consistent interaction with its outside dependencies. 647 more words

Scala

Mock Unit Testing using Mockito in Play Scala project

During Unit Testing in a Play Scala project, there arises a need to Mock certain Objects or Traits which are used in the unit, so that the unit being tested has a consistent interaction with its outside dependencies. 647 more words

Scala

JMockit for testing

One of the tenets of agile, or really any approach to developing software these days is good test coverage. QVCS-Enterprise has some unit tests and… 212 more words

QVCS

Springockito & Mockito doReturn/thenReturn.

Once again I found myself in the world of testing code. In this case, we wanted to check that our Spring configuration was wiring up properly. 302 more words

Java

Mockito: Effective Partial Mocking

Sometimes, we may only want to partially mock an object to unit test our code. There are several ways to skin this cat, but I’ll show two straightforward approaches that allow you to obtain the cat fur. 318 more words

Testing

Testing Spring MVC Rest controllers

Spring MVC 3.2 introduced the ability to test controllers via MockMVC. In this example, we will test a controller that returns JSON via @ResponseBody.

Here are the dependencies that you will need. 2,732 more words

Java