In a real-world scenario, when testing a system, there are some instances in which a test should only be executed under a specific environment. Integration tests that rely on a third-party system such as Operating System are one example. If that system goes down, we’ll omit the tests that need it to avoid build failure.…Read More A Guide to Conditional Tests Execution Using JUnit 5
In this article, we will cover the basics of Aspect-Oriented Programming (AOP). You will learn how to use AspectJ to provide different AOP advices to Spring Boot applications to support cross-cutting issues like logging, profiling, caching, and transaction management and finally we will do a practical implementation to record user operations using Spring Boot AOP.…Read More A guide to Spring Boot AOP to Record User Operations
In this tutorial, you will learn about JUnit5 Lifecycle methods. A Lifecycle Method is any method that is directly annotated or meta-annotated with @BeforeAll, @AfterAll, @BeforeEach, or @AfterEach. Let’s have a look at these annotations one by one. @BeforeAll When a method is annotated with @BeforeAll it means that the method should be executed before…Read More A Guide to JUnit5 Lifecycle Methods
In this tutorial, you will learn about Unit Testing AWS Lambda Function with Java. First, we will have a quick overview of Unit Testing. Then we will look at the required dependencies in order to do Unit Testing of AWS Lambda Function. After that, we will dive deep into the annotations that will be used…Read More Unit Testing AWS Lambda Function with Java
In this guide, you will learn to use @RepeatedTest and @ParametrizedTest annotations introduced in JUnit 5. We’ll look at the capability that lets us run a test a certain number of times. We’ll also look at interfaces that will allow us to retrieve information about the repeated tests. Moreover, we will also look at a…Read More A Guide to @RepeatedTest and @ParametrizedTest in JUnit 5
In this JUnit 5 and Rest Assured tutorial, I am going to share with you how to add JUnit 5 and Rest Assured support to your Spring Boot project. It will be more than that actually. This tutorial will cover: Add JUnit 5 and Rest Assured to Spring Boot Project, Create a new JUnit 5…Read More Create a JUnit 5 Test Case with Rest Assured. Video Tutorial.
Earlier I’ve published a blog post on now to create a RESTful Web Service(JAX-RS) to accept JSON payload with user profile details and how to save user profile details into a MySQL database using Java Hibernate framework. In this blog post I am going to share with you how to test(using JUnit and Mockito) it’s Service…Read More Test RESTful Web Service with JUnit and Mockito