@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();
}
//..... 이하 생략
}