Listing all the endpoints on startup can help debugging and testing.
ApplicationListener
Create a bean that implements ApplicationListener<ApplicationReadyEvent>. This bean will be called when the application is ready. override the onApplicationEvent method to list all the endpoints.
Another way to listen to the ApplicationReadyEvent is to use the EventListener annotation. EventListener marks a method as a listener for application events.
Spring Boot Actuator provides a set of production-ready features to help you monitor and manage your application. It includes a set of built-in endpoints that can be used to monitor the application. To enable actuator, add the following dependency to the pom.xml file.