November 2016
Intermediate to advanced
944 pages
21h 1m
English
If you wish to set up Spring Security in a MockMvc test, you can write this test next to our previous test:
package masterSpringMvc.user.api; import masterSpringMvc.MasterSpringMvcApplication; import masterSpringMvc.user.User; import masterSpringMvc.user.UserRepository; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.http.MediaType; import org.springframework.security.web.FilterChainProxy; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import ...
Read now
Unlock full access