
Description and introduce about the instructor and course.
Build a Quarkus rest API with get and post endpoints for company data in memory, using controller and service layers, five-field entity, and utilities for text length and prime numbers.
Test the rest api with postman, start the Quarkus app on localhost 8080, and create and fetch company objects via the company endpoint, preparing for unit tests with JUnit 5.
Write and run Quarkus rest API tests with JUnit 5, validating post and get endpoints for saving and fetching companies using rest assured.
Test the Meyuchas controller's two get endpoints by creating a Quarkus test class with standard annotations, validating true, false, and an integer result based on parameters, covering all endpoints.
Test the Mitchells service by validating service-layer methods with JUnit assertions using Quarkus injection to the real microservice; verify five is prime and zero is not, and test shard count.
Test a Quarkus rest api by simulating database transactions to save and validate a new company, handle failures, and list all companies with JUnit assertions and dependency injection.
Advance your Java with the Quarkus framework by building microservices with secure endpoints using Keycloak, exploring service communication, and delivering a native executable in under a second.
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.
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.