• Post category:StudyBullet-13
  • Reading time:4 mins read


Java and Quarkus Framework with JUnit 5

What you will learn

Learn about how to create a simple REST API with Java and Quarkus Framework

How to use Quarkus with JUnit 5 to test the endpoints REST and Service layer

Learn about using @TestTransaction annotation in tests with databases

Fundamentals and importance of Tests in Software Development

Description

Enhance your knowledge of the Java Ecosystem – Discover the Quarku Framework Features

A quick and objective course, straight to the point!

In this course you will learn in an objective and practical way how to create a simple REST API that uses GET and POST methods and you will also learn how to create Unit Tests for your Controller and Service layer classes.

Let’s use as an example the creation of a Company Entity with some sample data, for this we will make use of JPA/Hibernate annotations that are inserted in the context of the Quarkus Framework.

In the following steps, we will separate the REST API into controller and service layers, respecting the MVC model (Model View Controller) and finally, we will use Postman to make requests to this REST API.


Get Instant Notification of New Courses on our Telegram channel.


Then, we move on to the unit testing phase using the updated version of JUnit, the most widely used Testing Framework in the Java world.

In this phase we will create unit tests that validate the paths of our endpoints and the responses received.

Finally, let’s create unit tests for our Service layer. Here we test data processing and business rules and also create a test that simulates data persistence in the database.

Topics:

  • Understanding the importance of Unit Testing;
  • Creating a simple REST API with Java + Quarkus Framework;
  • Testing the API with Postman;
  • Creating unit tests for REST API endpoints;
  • Creating unit tests for Service classes;
  • Creating tests that validate data in the database.
English
language

Content

Introduction

Introduction
Software Requirements for this Course
Introduction and init REST API app

Testing the REST endpoints with Postman

Finish and Testing REST Endpoints

Testing Controller Layer with Quarkus and JUnit 5

Testing First Controller Class
Testing Second Controller Class

Testing Service Layer and DB Transaction

Testing First Service Class
Testing Second Service Class with Database Transaction
Next Steps with Quarkus