Tags » JUnit

Junit testing with Spring - part 2

In my previous post on the argument (Junit testing with Spring), I skipped a very interesting part of testing attributes in the code which are inside methods. 489 more words


Expected Exception Rule and Mocking Static Methods - JUnit

Today I was asked to consume a RESTful service so I started implementing it following Robert Cecil Martin’s rules for TDD and came across a new way (atleast for me) of testing the expected exception along with the error message so thought of sharing the way I implemented it as part of this post. 338 more words


Lane Johnson's agent released statement after filing vs. NFLPA

Eagles right tackle Lane Johnson served his 10-game suspension as a result oft esting positive for performance enhancing drugs for a second time but the saga continues. 179 more words

Philadelphia Eagles

Mockito and Deep Stubs

Sometimes when we are writing tests for our projects we don’t want to set any behaviour to a given Mock but at the same time when it’s a complex object, with one or more relations, we want such relations to be accessible/retrievable.  105 more words


Temporary Directory and File in JUnit

public TemporaryFolder testFolder = new TemporaryFolder();

File file = testFolder.newFile(“MyFileName.txt”);


Execution order of JUnit annotations

\In this blogpost, we will focus on understanding the order of execution of annotations provided by JUnit API.

JUnit supports 5 main annotations, listed as per the execution order. 171 more words