Home » test

Tag Archives: test

Mockito List Matcher Example

In the Mockito Tutorial for Beginners, we saw a general overview of the use of Mockito framework for Java unit tests. In this example,we will see how are and how to use the Mockito Matchers for List elements. For this example, we will use: Java 1.7.0 Eclipse Mars 2, release 4.5.2. JUnit 4. Mockito 1.10.19. Tip You may skip project ...

Read More »

PowerMock Mock Static Method Example

In the Mockito Tutorial for Beginners, we did a general introduction to the Mockito mocking framework for JUnit tests. One the things that we did not see, was the mocking of static methods. That is because Mockito doesn’t allow to do that. To solve this, we will use PowerMock, a framework that extends Mockito’s functionalities (and other mocking frameworks’ also), ...

Read More »

Mockito Tutorial for Beginners

Mocking is a testing technique widely used not only in Java, but in any other object oriented programming language, that consists in exchanging . There are several mocking testing frameworks for Java, but this tutorial will explain how to use Mockito, probably the most popular for Java language. For this tutorial, we will use: Java 1.7.0 Eclipse Mars 2, release ...

Read More »

“No JUnit Tests Found” Error Solution

1. Introduction One of the first steps that developers take in order to create Unit Test case is to ensure that their environment is ready. This means that all required libraries are setup properly and that the JUnit Test cases are correctly annotated. There might be a couple of technical hiccups like proper source folder configuration in your specific IDE, ...

Read More »

JUnit NetBeans Example

1. Introduction In this post I will introduce the basics of writing and running JUnit unit tests in NetBeans IDE. Testing an application is an integral part of the development cycle, and writing and maintaining unit tests can help ensure that the individual methods in your source code work correctly. The IDE’s support for JUnit testing framework allows developers to ...

Read More »