Unit test Springboot MockMvc returns 403 Forbidden

后端 未结 2 1567
余生分开走
余生分开走 2021-01-12 15:02

I wrote one unit test that tests UsersController. UsersControllerTest.findUser is working fine, but UsersControllerTest.insertGetModifyDelete it doesn\'t.

In the log

2条回答
  •  灰色年华
    2021-01-12 15:44

    I got around it with @AutoConfigureMockMvc(addFilters = false). Please make sure that this won't compromise other functionality on your HTTP stack.

提交回复
热议问题