I have a method in a @Controller which generates a ModelAndView and rendered a JSP page. The resulting HTML is a report which is refreshed on-screen every few minutes.
I've now been asked to provide a snapshot of the report on the last day of each month. I feel the best way to do this without too much refactoring of the application is on the last day of each month, simulate a call to the method that generates the report, and capture the generated HTML so it can be rendered at any point in future.
I know how to setup a scheduled task within Spring Boot, but I'm struggling to figure out how to simulate a call to a controller and grab the response as a String that contains the HTML response from the report.