1
これはコントローラの外観です。それをテストする方法とそれを行う方法は何ですか?簡単なSpringコントローラをテストするには?
@Controller パブリッククラスメインコントローラ{
@Autowired
private WeatherStateRepositoryDAO weatherStateRepositoryDAO;
@RequestMapping("/")
public String mainPage(Model model) {
model.addAttribute("list", weatherStateRepositoryDAO.findAll());
return "index";
}
}
次のSpringの入門ガイド - テストへの参照があり、How https://github.com/spring-guides/gs-rest-service/blob/master/complete/src/testへの回答があります。 /java/hello/GreetingControllerTests.java – bhantol