Skip to content

Commit 0973e96

Browse files
committed
Migrate to org.openmrs.test.jupiter.BaseModuleContextSensitiveTest
1 parent a77e050 commit 0973e96

File tree

6 files changed

+23
-123
lines changed

6 files changed

+23
-123
lines changed

api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
import static org.hamcrest.core.Is.is;
1313
import static org.junit.Assert.assertThat;
1414

15-
import org.junit.Before;
16-
import org.junit.Test;
15+
import org.junit.jupiter.api.BeforeEach;
16+
import org.junit.jupiter.api.Test;
1717
import org.openmrs.api.context.Context;
18-
import org.openmrs.test.BaseModuleContextSensitiveTest;
1918
import org.openmrs.test.SkipBaseSetup;
19+
import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
2020

2121
@SkipBaseSetup
2222
public class PrivilegedDataConverterTest extends BaseModuleContextSensitiveTest {
@@ -27,7 +27,7 @@ public class PrivilegedDataConverterTest extends BaseModuleContextSensitiveTest
2727
public static final String HAS_PRIV = "A privilege I have";
2828
public static final String DOES_NOT_HAVE_PRIV = "A privilege I do not have";
2929

30-
@Before
30+
@BeforeEach
3131
public void setUp() throws Exception {
3232
initializeInMemoryDatabase();
3333
executeDataSet("org/openmrs/module/reporting/include/PrivilegeTest.xml");

api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
package org.openmrs.module.reporting.data.patient.service;
1111

1212
import org.junit.Assert;
13-
import org.junit.Before;
14-
import org.junit.Test;
13+
import org.junit.jupiter.api.BeforeEach;
14+
import org.junit.jupiter.api.Test;
1515
import org.openmrs.Cohort;
1616
import org.openmrs.Patient;
1717
import org.openmrs.PersonAttribute;
@@ -31,7 +31,7 @@
3131
import org.openmrs.module.reporting.definition.library.DocumentedDefinition;
3232
import org.openmrs.module.reporting.evaluation.EvaluationContext;
3333
import org.openmrs.test.BaseContextSensitiveTest;
34-
import org.openmrs.test.BaseModuleContextSensitiveTest;
34+
import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
3535
import org.springframework.beans.factory.annotation.Autowired;
3636

3737
import java.util.Collections;
@@ -59,7 +59,7 @@ public class PatientDataServiceImplTest extends BaseModuleContextSensitiveTest {
5959
*
6060
* @throws Exception
6161
*/
62-
@Before
62+
@BeforeEach
6363
public void setup() throws Exception {
6464
executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET));
6565
}

api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
package org.openmrs.module.reporting.data.visit.evaluator;
1111

1212
import org.junit.Assert;
13-
import org.junit.Before;
14-
import org.junit.Test;
13+
import org.junit.jupiter.api.BeforeEach;
14+
import org.junit.jupiter.api.Test;
1515
import org.openmrs.Cohort;
1616
import org.openmrs.api.context.Context;
1717
import org.openmrs.module.reporting.common.TestUtil;
@@ -21,11 +21,11 @@
2121
import org.openmrs.module.reporting.evaluation.EvaluationContext;
2222
import org.openmrs.module.reporting.evaluation.context.VisitEvaluationContext;
2323
import org.openmrs.module.reporting.query.visit.VisitIdSet;
24-
import org.openmrs.test.BaseModuleContextSensitiveTest;
2524
import org.openmrs.test.SkipBaseSetup;
25+
import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
2626

2727
@SkipBaseSetup
28-
public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest{
28+
public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest {
2929

3030
protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/";
3131

@@ -37,7 +37,7 @@ public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest{
3737
*
3838
* @throws Exception
3939
*/
40-
@Before
40+
@BeforeEach
4141
public void setup() throws Exception {
4242
initializeInMemoryDatabase();
4343
authenticate();

api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,23 @@
99
*/
1010
package org.openmrs.module.reporting.evaluation;
1111

12-
import static org.junit.Assume.assumeTrue;
13-
1412
import org.apache.log4j.Appender;
1513
import org.apache.log4j.Level;
1614
import org.apache.log4j.LogManager;
1715
import org.apache.log4j.Logger;
1816
import org.apache.log4j.PatternLayout;
1917
import org.apache.log4j.WriterAppender;
20-
import org.junit.After;
2118
import org.junit.Assert;
22-
import org.junit.Before;
23-
import org.junit.Test;
19+
import org.junit.jupiter.api.AfterEach;
20+
import org.junit.jupiter.api.BeforeEach;
21+
import org.junit.jupiter.api.Test;
2422
import org.openmrs.api.context.Context;
2523
import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition;
2624
import org.openmrs.module.reporting.indicator.CohortIndicator;
2725
import org.openmrs.module.reporting.indicator.service.IndicatorService;
2826
import org.openmrs.module.reporting.test.OpenmrsVersionTestListener;
2927
import org.openmrs.module.reporting.test.RequiresVersion;
30-
import org.openmrs.test.BaseModuleContextSensitiveTest;
28+
import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
3129
import org.springframework.test.context.TestExecutionListeners;
3230

3331
import java.io.StringWriter;
@@ -52,7 +50,7 @@ public class EvaluationProfilerTest extends BaseModuleContextSensitiveTest {
5250
/**
5351
* Setup each test by configuring AOP on the relevant services and logging for the profiler class
5452
*/
55-
@Before
53+
@BeforeEach
5654
public void setup() {
5755
profiler1 = new EvaluationProfiler(new EvaluationContext());
5856
profiler2 = new EvaluationProfiler(new EvaluationContext());
@@ -70,7 +68,7 @@ public void setup() {
7068
/**
7169
* Cleanup after tests by removing AOP and resetting logging
7270
*/
73-
@After
71+
@AfterEach
7472
public void cleanup() {
7573
logger.setLevel(startingLevel);
7674
for (Appender appender : startingAppenders) {

api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest24On.java

Lines changed: 0 additions & 98 deletions
This file was deleted.

api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import org.apache.commons.logging.Log;
1313
import org.apache.commons.logging.LogFactory;
1414
import org.junit.Assert;
15-
import org.junit.Before;
16-
import org.junit.Test;
15+
import org.junit.jupiter.api.BeforeEach;
16+
import org.junit.jupiter.api.Test;
1717
import org.openmrs.Cohort;
1818
import org.openmrs.api.context.Context;
1919
import org.openmrs.module.reporting.common.TestUtil;
@@ -23,8 +23,8 @@
2323
import org.openmrs.module.reporting.query.obs.ObsQueryResult;
2424
import org.openmrs.module.reporting.query.obs.definition.SqlObsQuery;
2525
import org.openmrs.module.reporting.query.obs.service.ObsQueryService;
26-
import org.openmrs.test.BaseModuleContextSensitiveTest;
2726
import org.openmrs.test.SkipBaseSetup;
27+
import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
2828

2929
/**
3030
* Test the evaluation of the SqlObsQuery
@@ -34,7 +34,7 @@ public class SqlObsQueryEvaluatorTest extends BaseModuleContextSensitiveTest {
3434

3535
protected static Log log = LogFactory.getLog(SqlObsQueryEvaluatorTest.class);
3636

37-
@Before
37+
@BeforeEach
3838
public void setup() throws Exception {
3939
initializeInMemoryDatabase();
4040
authenticate();

0 commit comments

Comments
 (0)