-
카테고리
-
세부 분야
백엔드
-
해결 여부
미해결
부트 + jupiter 인 경우 설정법
22.06.23 15:15 작성 조회수 219
0
@SpringBootTest
@AutoConfigureMockMvc
@ExtendWith(RestDocumentationExtension.class)
class EventControllerTest {
private MockMvc mockMvc;
private WebApplicationContext webApplicationContext;
private final ObjectMapper objectMapper;
private final EventRepository eventRepository;
@Autowired
public EventControllerTest(WebApplicationContext webApplicationContext, ObjectMapper objectMapper, EventRepository eventRepository) {
this.webApplicationContext = webApplicationContext;
this.objectMapper = objectMapper;
this.eventRepository = eventRepository;
}
@BeforeEach
public void setUp(RestDocumentationContextProvider restDocumentation) {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.webApplicationContext)
.apply(documentationConfiguration(restDocumentation)).build();
}
//..... 이하 생략
}
답변을 작성해보세요.
0
답변 1