I am using MockHttpServletRequestBuilder to create my request for testing my framework. One of the request parameters I have is a string array. For my testing I want to test with passing an empty array in my request. However, the assertion in MockHttpServletRequestBuilder.addToMultiValueMap doesn't let me to pass null or empty values.
This is the error body I am getting:
java.lang.IllegalArgumentException: 'values' must not be empty
at org.springframework.util.Assert.notEmpty(Assert.java:214)
at org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder.addToMultiValueMap(MockHttpServletRequestBuilder.java:698)
at org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder.param(MockHttpServletRequestBuilder.java:153)
at MyMockApiRequests.queryPath(MockJdbcApiRequests.java:105)
Is there any other way to test this condition?