We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've got this simple controller route that returns a fragment with a trigger so my front-end can handle the outcome of the request:
@HxRequest @HxTrigger("historyCreated") @PostMapping public ModelAndView createHistory(@ModelAttribute EmployeeHistoryDTO employeeHistoryDTO, Model model) { employeeHistoryService.create(employeeHistoryDTO); Employee employee = (Employee) employeeService.getById(employeeHistoryDTO.getEmployee().getId()); model.addAttribute("employee", employee); ModelAndView modelAndView = new ModelAndView( "employee-detail :: employeeHistory"); modelAndView.addAllObjects(model.asMap()); return modelAndView; }
How can i test if it's sending the header correctly with junit? I tried using a response object to see its headers but there's nothing there.
The text was updated successfully, but these errors were encountered:
Are you using Spring and MockMVC in your test? There are tests in this codebase that validates headers. I would recommend that approach: https://github.com/wimdeblauwe/htmx-spring-boot/blob/main/htmx-spring-boot/src/test/java/io/github/wimdeblauwe/htmx/spring/boot/mvc/HtmxResponseHandlerMethodArgumentResolverTest.java#L32
Sorry, something went wrong.
No branches or pull requests
I've got this simple controller route that returns a fragment with a trigger so my front-end can handle the outcome of the request:
How can i test if it's sending the header correctly with junit? I tried using a response object to see its headers but there's nothing there.
The text was updated successfully, but these errors were encountered: