February 2017
Intermediate to advanced
1023 pages
24h 11m
English
We will take the example of the Spring MVC from this chapter as a target application to test and execute unit testing. We have the EmployeeController class as a target class to test.
You'll find the following code in EmployeeController.java:
package org.packt.Spring.chapter7.springmvc.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller @RequestMapping("/employee") public class EmployeeController { @RequestMapping(method = RequestMethod.GET) public String welcomeEmployee(ModelMap model) { model.addAttribute("name", "Hello ...Read now
Unlock full access