Spring Boot

Repository Testing

Repository testing checks that JPA repository methods and queries work correctly against a real database. It is used to catch wrong derived-method names, wrong @Query JPQL and constraint problems early, before the service or controller layers run. @DataJpaTest loads only the JPA layer (entities and repositories), so the test starts quickly. Tests run against a […]

Repository Testing Read More »

Controller Testing

Controller testing checks that REST endpoints return the right status codes and JSON without starting a server or opening a browser. It is used to verify URL mapping, request-body conversion and response handling quickly and automatically. Spring’s MockMvc sends fake HTTP requests straight into the controller and lets you assert on the response. Only the

Controller Testing Read More »

Mockito

Mockito is a Java library that creates fake (mock) objects so a class can be tested on its own. It is used to isolate business logic: the service is tested without a real database or repository. A mock returns whatever you tell it to, so tests are fast, repeatable and need no MySQL. You can

Mockito Read More »

Unit Testing

Unit testing is a software testing technique used to verify individual components of an application independently from the rest of the system. In Spring Boot, JUnit 5 is commonly used to write and execute test cases, while Mockito is used to create mock objects for dependencies such as repositories. For example, a StudentService class may

Unit Testing Read More »

Testing Spring Boot Applications

Testing Spring Boot Applications involves verifying application logic, component wiring, and system interactions across different layers of the software stack to ensure reliability, correctness, and maintainability. Spring Boot simplifies this process through the spring-boot-starter-test dependency, which bundles industry-standard libraries (such as JUnit 5, Mockito, AssertJ, and Hamcrest) and provides specialized annotations for isolated unit testing,

Testing Spring Boot Applications Read More »

Scheduled Tasks

Scheduled processing lets a Spring Boot application run a method automatically at fixed times or intervals, without any user request. You enable it with @EnableScheduling and mark a method with @Scheduled, and Spring runs it on a background thread. It is used for daily reports, data cleanup, sending reminders, syncing with other systems, and cache

Scheduled Tasks Read More »

PDF Export

PDF export converts application data into a fixed-layout document that looks the same on every device and prints cleanly.In Spring Boot, a PDF library (here OpenPDF) builds the document in memory as a byte[], and the controller returns it with the application/pdf content type.Unlike CSV or Excel, a PDF is meant for reading and printing,

PDF Export Read More »

Scroll to Top