Memorynotfound Java Programming Tutorials
Defining and Passing JSF Context Parameters
This tutorial shows you how Context Parameters are defined in web.xml file and how you can access them in you JSF Managed bean or using the EL Expression language to retrieve them. Create a...
Produce Consume RabbitMQ Spring JSON Message Queue
In this tutorial we explain how to configure RabbitMQ with Spring to Produce and Consume JSON messages over a queue. This tutorial uses spring java configuration instead of the xml configuration. After this tutorial...
Asynchronous service with spring @Async and Java Future
In this tutorial we use Java’s Future callback together with Spring @Async Thread execution. Whenever you want to make a time consuming task the best practice is to start this in a new thread...
Spying on real objects using Mockito Spy
In this tutorial we will explain more about Mockito Spies. We learn how to create a spy method, use the @Spy annotation and finally learn how to stub a spy. Dependencies First we start...
Verify Behaviour of your services with Mockity verify()
In this example we explain how to use Mockito verify to verify complex behaviour of our services. Here is a list of what we can verify: Verify some behaviour Stub expected values Verifying exact...
Initialize Mockito Tests with JUnit
This example show you how to initialize mockito tests using annotations. First we can use the MockitoAnnotations.initMocks(this) method to explicitly initialize the annotated mocks. The MockitoJUnitRunner JUnit runner uses the MockitoAnnotations.initMocks(this) method to initialize...
Add Maven Build Information to Properties File
This example shows you how to add your Maven Build Information like version number, build time, etc.. to a properties file. We use the resource filtering from the maven-resources-plugin. We get the information like...
JUnit Ignore Test using @Ignore Annotation
Suppose we have some failing unit test because of a system reconfiguration or a change of client requirements or even a developer wrote some bad tests and he is currently on vacation. But we...
JUnit Timeout for Test Method Execution
This tutorial shows how the JUnit Timeout works. You can specify a timeout in JUnit, this means that when a test execution is longer than the specified timeout the test method will fail automatically...