Home » JUnit » Page 19

Tag Archives: JUnit

Testing an Object’s Internal State with PowerMock

Most unit testing focuses on testing an object’s behaviour in order to prove that it works. This is achieved by writing a JUnit test that calls an object’s public methods and then testing that the return values from these calls match some previously defined set of expected values. This is a very common and successful technique; however, it shouldn’t be ...

Read More »

Testing with Scala

When learning a new language or framework one of my early questions is nowadays: What about testing? Obviously I asked that for Scala as well. If there is anything to complain about I guess it is once more the large number of options one has. JUnit Scala is highly compatible with Java and this includes the popular testing framework Junit. ...

Read More »

Rules in JUnit 4.9 (beta 3)

Some time ago David Saff announced a beta release of JUnit 4.9. So I guess it is a good point in time to look into what is new in this version. One of the most useful innovations in the JUnit realm have been Rules. I wrote about Rules here. And I wrote about use cases for JUnit Rules here. Rules ...

Read More »