일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 스프링
- Android
- QueryDSL
- spring
- Proxy
- 스프링 핵심 원리
- transaction
- 알고리즘
- AOP
- Thymeleaf
- Exception
- jpa
- http
- Spring Boot
- java
- db
- Greedy
- pointcut
- Servlet
- 그리디
- 인프런
- springdatajpa
- kotlin
- 김영한
- SpringBoot
- JDBC
- JPQL
- 스프링 핵심 기능
- 자바
- 백준
- Today
- Total
목록mockmvc (2)
개발자되기 프로젝트
1. @WebMvcTest, @AutoConfigureMockMvc MVC를 test하기 위해서는 모든 SpringBoot를 불러올 필요가 없음. @WebMvcTest @AutoConfigureMockMvc internal class ExceptionApiControllerTest { } 2. MockMvc @Autowired lateinit var mockMvc: MockMvc 3. Test1 @Test fun helloTest(){ mockMvc.perform( MockMvcRequestBuilders.get("/api/exception/hello") ).andExpect( MockMvcResultMatchers.status().isOk ).andExpect( MockMvcResultMatchers...
1. PostController Test 비로그인 유저가 글 등록/삭제/수정을 시도하는 경우 Interceptor에 의해 로그인 화면으로 이동하며, 로그인 시도한 페이지를 QueryParam으로 넘겨준다. /** * 비로그인 유저가 글 작성/수정/삭제 시도하는 경우 * 로그인 화면으로 이동됨 by inteceptor */ @Test void 비로그인_글작성_시도_GET() throws Exception { String redirectUtl = "/login?redirectURL=/posts/new/form"; mockMvc.perform(get("/posts/new/form")) .andExpect(redirectedUrl(redirectUtl)); } @Test void 비로그인_글작성_시도_POST(..