
Install the Java development kit and a preferred editor (IntelliJ), set up Postman for web API testing, configure Maven and Git, and connect to databases by configuring environment variables.
Learn how to perform a full update of a property using a put mapping: fetch by id, override fields with new values, save, and return the updated property.
Learn to write unit tests for a calculator controller, cover multiple scenarios with assertions, enable or disable tests, and use code coverage to verify all code paths are tested.
Show how to use Mockito when/then to bypass a dependency and unit test a controller by mocking the service, returning a dummy object, and validating the response status.
Develop and execute a unit test for the service's get all properties method, mocking the repository findAll, returning a property entity list, and validating the converted results.
Create a unit test to update a property's description in the service layer, verify other fields stay unchanged, bypass the converter, and assert the updated description.
https://github.com/ranjanpandeysbp/junit-mockito-springboot
Don't forget to follow the github page for future updates.
Welcome to this amazing course, where you will learn about:
What is unit testing?
Why is unit testing important?
What is Test Driven Development(TDD) ?
How to apply Test Driven Development to the projects?
What is Junit and Mockito?
We will learn to write unit tests using Junit 5 Framework and Mockito Library.
We will start with how projects are developed in software companies using modern stacks like Java, Spring, SpringBoot, Hibernate, Spring Data JPA and Restful webservices.
In this course you will be understanding how different technology and its components work together to build a real world application which end users are able to use in real life. It will be a Property Management System.
We will also learn to relate different concepts with real world examples. In this course we will learn the following:
We will learn different concepts Spring Framework and RESTful webservices
We will learn about different design patterns like Singleton, Prototype, Factory, MVC, Adapter etc
We will learn to create production ready application in a layered architecture
We will learn about ORM and Spring data JPA(Java Persistence API)
What is Unit Testing
What is TDD(Test Driven Development)
Why is Testing important
What is Junit and Mockito
Different Annotations of Junit and Mockito
Comparison between Junit-4 and Junit-5
Writing Test cases for the project’s different API endpoints
Checking the code coverage & Debugging
Writing Test cases for Success, Failure and Error scenarios
Test cases for Model classes
You will also get the complete source code used in the course.