Top "Spring-mvc-test" questions

Failed to load ApplicationContext for JUnit test of Spring controller

I want to write a test case to check my controller (getPersons). This is a server side code. I have …

spring spring-mvc junit junit4 spring-mvc-test
How to avoid the "Circular view path" exception with Spring MVC test

I have the following code in one of my controllers: @Controller @RequestMapping("/preference") public class PreferenceController { @RequestMapping(method = RequestMethod.GET, …

spring spring-mvc circular-reference thymeleaf spring-mvc-test
Mock MVC - Add Request Parameter to test

I am using spring 3.2 mock mvc to test my controller.My code is @Autowired private Client client; @RequestMapping(value = "/user", …

spring spring-mvc spring-mvc-test
Testing Spring MVC @ExceptionHandler method with Spring MVC Test

I have the following simple controller to catch any unexpected exceptions: @ControllerAdvice public class ExceptionController { @ExceptionHandler(Throwable.class) @ResponseStatus(value = …

spring spring-mvc mockito spring-mvc-test
Testing Spring MVC Router with MockMVC

I'm trying to test my Spring MVC webapp with Spring test. It uses springmvc-router for routing and that appears to …

java spring-mvc junit spring-mvc-test
Spring MVC test with MockMvc

I'm trying to run a test for testing a Spring MVC controller. The test compile and runs, but my problem …

java spring unit-testing mocking spring-mvc-test
Setting up MockMvc with @WebMvcTest in Spring Boot 1.4 MVC Testing

I have few working code to set up MockMVc in different ways with the new Spring Boot 1.4 @WebMvcTest. I understand …

spring-mvc spring-boot spring-mvc-test
@WebAppConfiguration not injected

I am trying to create spring-mvc tests using Spring 3.2.1. Following some tutorials, I thought this would be straight-forward. Here is …

unit-testing spring-mvc spring-mvc-test
Assertion error: No value for JSON Path in JUnit test

I have written a test and it succeeded before but now I get an AssertionError: No value for JSON Path. @…

java json junit spring-mvc-test
Spring MVC Controller Exception Test

I have the following code @RequestMapping(value = "admin/category/edit/{id}",method = RequestMethod.GET) public String editForm(Model model,@PathVariable …

spring-mvc spring-mvc-test springmockito