John Mark opened SPR-10771 and commented
The current API for MockRestServiceServer and MockRestRequestMatchers does not allow a test to validate that a certain header value does not exist. Trying to do
.andExpect(header("Custom-Header", Matchers.nullValue()))
does not work because it requires the header to first exist, and then checks the Matcher. I would like to be able to so something like this:
.andExpect(header("Custom-Header").doesNotExist())
or something to that effect.
Unfortunately, I don't see any workaround for this until spring-test supports it. I was forced to use Mockito ArgumentCaptors in order to verify this requirement, but that meant that I couldn't use MockRestServiceServer.
Affects: 3.2.3
Referenced from: commits 4bf5a02
John Mark opened SPR-10771 and commented
The current API for MockRestServiceServer and MockRestRequestMatchers does not allow a test to validate that a certain header value does not exist. Trying to do
does not work because it requires the header to first exist, and then checks the Matcher. I would like to be able to so something like this:
or something to that effect.
Unfortunately, I don't see any workaround for this until spring-test supports it. I was forced to use Mockito ArgumentCaptors in order to verify this requirement, but that meant that I couldn't use MockRestServiceServer.
Affects: 3.2.3
Referenced from: commits 4bf5a02