스프링

spring mvc showcase

https://github.com/spring-projects/spring-mvc-showcase

 

Spring Security Reference

 

javax.servlet-api 라이브러리 버전 변경

		<!-- Servlet -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.1.0</version>
			<scope>provided</scope>
		</dependency>

 

 

 

class HomControllerTest

package com.java.web;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standaloneSetup;

import org.junit.Test;

public class HomControllerTest {

	@Test
	public void home() throws Exception{
		standaloneSetup(new HomeController()).build()
		.perform(get("/"))
		.andExpect(status().isOk())
		.andExpect(forwardedUrl("home"));

	}
	
}

 

 

INFO : org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.4.0.Final
INFO : org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.test.web.servlet.setup.StubWebApplicationContext@66d33a
INFO : org.springframework.mock.web.MockServletContext - Initializing Spring FrameworkServlet ''
INFO : org.springframework.test.web.servlet.TestDispatcherServlet - FrameworkServlet '': initialization started
INFO : org.springframework.test.web.servlet.TestDispatcherServlet - FrameworkServlet '': initialization completed in 4 ms
INFO : com.java.web.HomeController - Welcome home! The client locale is en.

 

 

 

spring

 

about author

PHRASE

Level 60  머나먼나라

복수는 개인의 일이며, 벌은 신의 일이다. 사회는 양자의 중간에 있다. 징벌은 사회보다 이상의 것이며, 복수는 사회보다 이하의 것이다. -빅토르 마리 위고

댓글 ( 4)

댓글 남기기

작성