Top "Mockmvc" questions

MockMVC is the key part of the Spring MVC Test framework is.

How to test if JSON path does not include a specific element, or if the element is present it is null?

I have been writing some simple unit testing routines for a simple spring web application. When I add @JsonIgnore annotation …

java unit-testing spring-mvc jsonpath mockmvc
Spring Controller testing with MockMvc post method

I am trying to test a method of my controller in a Spring Boot application. This is a post endpoint, …

unit-testing spring-mvc spring-boot mockito mockmvc
Asserting array of arrays with JSONPath and spring mvc

I'm having difficulty figuring out how to assert with jsonPath in a JSON document response in spring mvc. Perhaps there's …

spring-mvc junit jsonpath mockmvc
Hamcrest with MockMvc: check that key exists but value may be null

I'm doing some tests with MockMvc, and I want to validate the structure of a JSON response. Specifically, I want …

java hamcrest jsonpath mockmvc
mockMvc - Test Error Message

Does anybody have any tips, or does anybody know how I can test the "error message" returned by the HTTP …

spring-mvc mockmvc
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted() while using Mockito with Junit

I am trying to get my feet wet with TDD. I am trying to write unit test cases for controllers …

java junit mocking mockito mockmvc
Upload file using Spring mvc and MockMVC

I have successfully uploaded a image file to WebContent\resources\uploads\image.jsp. But I am facing a problem in …

java spring mockmvc
java.lang.AssertionError: Content type not set - Spring Controller Junit Tests

I am trying to do some unit testing on my controllers. No matter what I do all controller tests return …

java spring spring-mvc junit mockmvc
MockMvc returning 404 status

I am trying to write test cases for controller. I do not want to mock out my service as I …

java spring junit mockmvc
how to treat controller exception with mockmvc

I am using MockMVC to test my controller. I have the following controller: public class A{ ... @RequestMapping("/get") public List&…

java spring mockmvc