UTBotJava icon indicating copy to clipboard operation
UTBotJava copied to clipboard

Support more parameter annotations and types for testing `@Controller`

Open alisevych opened this issue 3 years ago • 0 comments

Description

#2447 only adds support for parameters annotated with @RequestBody and @PathVariable annotations.

Here are some more annotations that can be supported in a similar manner (sorted roughly in popularity decreasing order):

  1. @RequestParam
  2. @Valid (depends on #2340)
  3. @RequestHeader
  4. @ModelAttribute (see also @ControllerAdvice)
  5. @CookieValue
  6. @RequestAttribute
  7. @RequestPart
  8. @SessionAttribute
  9. @MatrixVariable

Here are some more types that are treated specially by Spring (sorted roughly in popularity decreasing order):

  1. HttpServletRequest
  2. BindingResult
  3. Model and ModelMap
  4. Map<String, String> (with @RequestParam or @PathVariable annotations)
  5. Optional<T>
  6. Authentication
  7. HttpHeaders (with @RequestHeader annotation)
  8. HttpSession
  9. RedirectAttributes
  10. Locale

alisevych avatar Jul 31 '23 09:07 alisevych