Skip to content

Support more parameter annotations and types for testing @Controller #2462

Open
@alisevych

Description

@alisevych

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 Create a good EntityValueProvider for Spring fuzzing #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

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorcomp-instrumented-processIssue is related to Instrumented processcomp-springIssue is related to Spring projects supportctg-enhancementNew feature, improvement or change request

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions