Quantcast
Channel: junit Archives - Java Code Geeks
Browsing latest articles
Browse All 27 View Live

JUnit Example for Spring Controller

In this example, we shall show users the usage of JUnit Spring Controller Example. There are many ways where we can test Spring controller. There is also a specific test framework, especially for...

View Article


JUnit doNothing Example

In this tutorial we shall show users the usage of doNothing method. This method is basically resides inside the Mockito framework and is not a part of the JUnit. 1. Introduction Many developers thought...

View Article


JUnit Selenium Grid Example

1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it’s significance. We will create a Page Object and then we will access that page object from...

View Article

JUnit HttpUnit Example

Hello, in this example we shall show you how you can make a use of the JUnit HTTUnit to test web applications. In this example, we will build a small web application and test it using HTTPUnit. This...

View Article

Java Unit Testing with JUnit Example

This is an article for Java Unit Testing with JUnit Example. You can also check this tutorial in the following video: JUnit Testing in Java – video 1. Introduction Java unit testing is a software...

View Article


Assert ‘Exception thrown’ Junit

1. Introduction In the Java programming language, an assertion is a statement that enables you to test your program’s presumptions. You predict that each boolean expression in an assertion will be true...

View Article

Test Main Method with JUnit

The entry point for any Java application is the main() method, and its structure can vary based on the application type. For typical web applications, the main() method initiates the context, while...

View Article

JUnit Assert Regex Matches

JUnit is often the initial preference for developers when conducting unit tests on Java code. In practical situations, a frequent testing need is to verify if a specified string adheres to a specific...

View Article


Constructor Unit Testing with Mockito

Constructor unit testing with Mockito is a task Java developers come across really often. In this brief tutorial, we will delve into the diverse choices available for proficiently simulating...

View Article


Mock Same Method with Different Parameters

When creating a mock for a Java method, it proves beneficial to obtain varied responses depending on the provided parameters. Let us delve into the article to understand the mocking of the Java method...

View Article
Browsing latest articles
Browse All 27 View Live