Blog Archives
1 2

01: JUnit with Mockito step by step

Step 1: Create a simple maven project say “code-quality”

Step 2: Import into eclipse.

#1. Validator code & unit testing

Step

Read more ›



02: Unit testing with JUnit, Mockito & Spring

Step 1: Create a simple Maven project from a command-line. Just press enter for all the prompts.

Step 2: Import the …

Read more ›



03: Mockito to fully mock the DAO layer

This extends Part 1: Unit testing with JUnit, Mockito & Spring by mocking the DAO layer with the Mockito framework. Step … … Read more ›...

Members Only Content
Log In Register Home


04: Mockito partially mocking with @Spy

This extends Part 2: Mockito to fully mock the DAO layer by modifying the service layer to demonstrate partial mocking with … … Read more ›...

Members Only Content
Log In Register Home


05: Mockito & PowerMock partially mocking private methods with @Spy

This extends Part 3: Mockito partially mocking with @Spy by making the method “processUser(int id)” as a private method. Mockito framework … … Read more ›...

Members Only Content
Log In Register Home


06: Mockito & PowerMock for mocking static methods

This extends Part 4: Mockito & PowerMock for partially mocking private methods to mock “static” methods.

How to use …

Read more ›



5 Java unit testing interview Questions and Answers

Q1 Why use mock objects in unit testing? A1 Unit testing is widely accepted as a “best practice” for software development. … … Read more ›...

Members Only Content
Log In Register Home


Integration Unit testing Spring Transaction Management

This is an integration testing that tests Spring transaction through service, and DAO layers all the way up to the embedded … … Read more ›...

Members Only Content
Log In Register Home


Java BDD (Behavior Driven Development) interview Q&A

Q1. What is BDD? A1. BDD is principally an idea about how software development should be managed by both business interests … … Read more ›...

Members Only Content
Log In Register Home


jBehave and BDD example

To appreciate jBehave, let’s look at a better example here. This example is about a science formula   Speed = distance … … Read more ›...

Members Only Content
Log In Register Home


jBehave and jUnit for BDD

This extends the jBehave — Behavioural Driven Development (BDD) Q&A to use the same example with jUnit testing. Step 1: … … Read more ›...

Members Only Content
Log In Register Home


jBehave with tabular story data

This extends the previous jBehave and BDD tutorials. The story is in a tabular format as shown below. This is … … Read more ›...

Members Only Content
Log In Register Home


JUnit with Hamcrest

Q1. What is Hamcrest, and what is its purpose?
A1. HAMCREST is an anagram for MATCHER. The purpose is to …

Read more ›



1 2

Java FAQs to Fast-track & Go places

Java Interview Q&As

Top