|
34 | 34 | import org.gridsuite.voltageinit.server.service.parameters.FilterService;
|
35 | 35 | import org.gridsuite.voltageinit.server.service.parameters.VoltageInitParametersService;
|
36 | 36 | import org.gridsuite.voltageinit.server.util.VoltageLimitParameterType;
|
37 |
| -import org.junit.jupiter.api.AfterEach; |
38 | 37 | import org.junit.jupiter.api.BeforeEach;
|
39 | 38 | import org.junit.jupiter.api.Test;
|
40 | 39 | import org.springframework.beans.factory.annotation.Autowired;
|
41 | 40 | import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
42 | 41 | import org.springframework.boot.test.context.SpringBootTest;
|
43 | 42 | import org.springframework.boot.test.mock.mockito.MockBean;
|
44 | 43 | import org.springframework.http.MediaType;
|
| 44 | +import org.springframework.test.annotation.DirtiesContext; |
| 45 | +import org.springframework.test.annotation.DirtiesContext.ClassMode; |
45 | 46 | import org.springframework.test.web.servlet.MockMvc;
|
46 | 47 | import org.springframework.test.web.servlet.MvcResult;
|
47 | 48 | import org.springframework.transaction.annotation.Transactional;
|
|
58 | 59 | * @author Ayoub LABIDI <ayoub.labidi at rte-france.com>
|
59 | 60 | */
|
60 | 61 | @SpringBootTest
|
| 62 | +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) |
61 | 63 | @AutoConfigureMockMvc
|
62 | 64 | @Transactional
|
63 | 65 | class VoltageInitParametersTest {
|
@@ -117,13 +119,6 @@ public void setup() {
|
117 | 119 | equipmentsList2.add(new FilterEquipments(FILTER_UUID_2, FILTER_2, identifiableAttributes2, List.of()));
|
118 | 120 | given(filterService.exportFilters(List.of(FILTER_UUID_1), NETWORK_UUID, VARIANT_ID_1)).willReturn(equipmentsList1);
|
119 | 121 | given(filterService.exportFilters(List.of(FILTER_UUID_2), NETWORK_UUID, VARIANT_ID_1)).willReturn(equipmentsList2);
|
120 |
| - |
121 |
| - parametersRepository.deleteAll(); |
122 |
| - } |
123 |
| - |
124 |
| - @AfterEach |
125 |
| - public void tearOff() { |
126 |
| - parametersRepository.deleteAll(); |
127 | 122 | }
|
128 | 123 |
|
129 | 124 | @Test
|
|
0 commit comments