Skip to content

Commit

Permalink
OP-336 Convert test to junit5 and test contextLoads() method (#429)
Browse files Browse the repository at this point in the history
* Restore contextLoads() test

* Convert LaboratoryControllerTest to JUnit5

* Comment out the test and update the comment with suggestion
  • Loading branch information
mwithi committed Feb 1, 2024
1 parent ec3a6ef commit 6acd1bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/test/java/org/isf/OpenHospitalApiApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
@SpringBootTest
public class OpenHospitalApiApplicationTests {

// FIXME: test application context loading
// @Test
// public void contextLoads() {
// /*
// * Context loading is working correctly. However, since this test does not provide any additional value and may actually slow down the tests execution,
// * it's recommended to remove it. The loading context is implicitly tested by other tests that run as SpringBootTest.
// */
// }

}
6 changes: 3 additions & 3 deletions src/test/java/org/isf/lab/rest/LaboratoryControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
import org.isf.shared.exceptions.OHResponseEntityExceptionHandler;
import org.isf.shared.mapper.converter.BlobToByteArrayConverter;
import org.isf.shared.mapper.converter.ByteArrayToBlobConverter;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.modelmapper.ModelMapper;
Expand Down Expand Up @@ -87,7 +87,7 @@ public class LaboratoryControllerTest {

private MockMvc mockMvc;

@Before
@BeforeEach
public void setup() {
MockitoAnnotations.initMocks(this);
this.mockMvc = MockMvcBuilders
Expand Down

0 comments on commit 6acd1bf

Please sign in to comment.