스프링 2.5

A collection of 3 posts
스프링 2.5

스프링 2.5 @MVC 컨트롤러 테스트관련 궁금한거..

@Controller @RequestMapping(“board/*.do”) @SessionAttributes(value=”board”) public class BoardController { @Autowired private BoardService boardService; @Autowired private BoardValidator validator; @RequestMapping public void list(ModelMap model){ model.addAttribute(boardService.getAll()); } @RequestMapping(method=RequestMethod.GET) public void add(ModelMap model){ model.addAttribute(new Board()); } @RequestMapping(method=RequestMethod.POST) public String add(@ModelAttribute(“board”
3 min read
테스트 코드

스프링 2.5 기반(JUnit 4.4 사용) 테스트 코드

package whiteship; import static org.junit.Assert.*; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration public class MemberTest { @Autowired private Member member; @Test public void
2 min read