Bean Scopes
Author: Armando Marques
Spring MVC Tests
MVC Test framework Provide support for Spring MVC code, having requests processed through DispatcherServlet without container. It uses MockMvcRequestBuilders and MockMvcResultMatchers. Web environment types: DEFINED_PORT, MOCK, NONE, RANDOM_PORT. Default is Mock @LocalServerPort or @Value(“${local.server.port}”) to get test local port. TestRestTemplate Alternative to RestTemplate for integration tests. Slice testing Performs isolated testing within a slice of an application,…
Spring Exception Handler
Error Handling for REST with Spring Before Spring 3.2 the two main approaches to handle exceptions where HandleExceptionResolver or @ExceptionHandler annotation. The it was added @ControllerAdvice and ResponseStatusException. Controller level (MVC) This strategy only works for active controllers is not global to the entire application. HandleExceptionResolver This is enabled by default in DispatchServlet. DefaultHandlerExceptionResolver Used…
Reactive programming
Reactive programming
Spring Security
Spring Security