Or Cohen
11/03/2019, 12:50 PMWebMvc.fn
instead of using @RequestMapping
annotations.
Since I’m now using request handlers rather than controllers, my controller unit tests (MockMvc
with standalone setup) are obviously failing 🙂
I’m trying to fix my unit tests but I’m struggling making things work. Seems like every request I’m making using MockMvc
(without standalone steup this time) ends up with 404.
When I run my app or my integration tests, everything works just fine, so I’m guessing it’s somehow related to the routes bean not being loaded to the app context. Failed to work around it though.
Any ideas? am I missing something?Mike
11/03/2019, 4:10 PMOr Cohen
11/03/2019, 4:48 PMServerRequest
and ServerResponse
objects. That’s why I thought to replace my controller unit tests with route-handler unit tests using MockMvc
.
Eventually I needed to create a custom context initializer for my tests and also use the beans
DSL in which I register my routing bean.
Once I added these beans when calling runApplication
everything worked as expected.sdeleuze
11/05/2019, 10:31 AMsdeleuze
11/05/2019, 10:31 AMsdeleuze
11/05/2019, 4:35 PMOr Cohen
11/07/2019, 8:17 AM