mockMvcを使用したControllerのテスト方法(Spring Boot) Controllerのテストやフィルターやインターセプターが実際に動作しているのか検証する際にMockMvcを使用する。 テストの作成方法をメモしておく。 シンプルなControllerのテスト作成 以下がテスト対象のコントローラークラスだとする。 @Controller public class SampleController { @RequestMapping(value = "/", method = RequestMethod.GET) public String forwardStartPage(M…