-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractIntegrationTest.java
More file actions
36 lines (28 loc) · 1020 Bytes
/
AbstractIntegrationTest.java
File metadata and controls
36 lines (28 loc) · 1020 Bytes
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
32
33
34
35
36
package com.mpc.springboot.shared;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.transaction.annotation.Transactional;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mpc.springboot.Application;
import com.mpc.springboot.shared.utils.TagUtils;
import org.junit.jupiter.api.*;
@SpringBootTest(classes = Application.class)
@AutoConfigureMockMvc
@Transactional
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class AbstractIntegrationTest {
@Autowired
protected MockMvc mockMvc;
@Autowired
protected ObjectMapper objectMapper;
@BeforeEach
void commonSetUp(TestInfo testInfo) {
if (TagUtils.hasNoSetupTag(testInfo)) {
return;
}
setUp();
}
protected abstract void setUp();
}