diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index df6445a783..d4c5ce5d9d 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
platform: [ ubuntu-latest ]
- java-version: [ 8 ]
+ java-version: [ 8, 11, 17, 21, 24 ]
runs-on: ${{ matrix.platform }}
env:
diff --git a/api-tests/pom.xml b/api-tests/pom.xml
index 9c13697504..5eed86d7bd 100644
--- a/api-tests/pom.xml
+++ b/api-tests/pom.xml
@@ -4,7 +4,7 @@
org.openmrs.module
reporting
- 1.29.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
reporting-api-tests
@@ -40,6 +40,14 @@
javassist
javassist
+
+ org.powermock
+ powermock-api-mockito2
+
+
+ org.powermock
+ powermock-api-mockito
+
@@ -52,6 +60,14 @@
javassist
javassist
+
+ org.powermock
+ powermock-api-mockito2
+
+
+ org.powermock
+ powermock-api-mockito
+
@@ -64,6 +80,14 @@
javassist
javassist
+
+ org.powermock
+ powermock-api-mockito2
+
+
+ org.powermock
+ powermock-api-mockito
+
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluatorTest.java
index 8479486659..9df515e484 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluatorTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluatorTest.java
@@ -14,9 +14,9 @@
import java.util.Collections;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import org.openmrs.Cohort;
import org.openmrs.Encounter;
import org.openmrs.EncounterType;
@@ -34,17 +34,21 @@
import org.openmrs.module.reporting.common.TimeQualifier;
import org.openmrs.module.reporting.definition.DefinitionContext;
import org.openmrs.module.reporting.evaluation.EvaluationContext;
-import org.openmrs.test.BaseModuleContextSensitiveTest;
+import org.openmrs.test.SkipBaseSetup;
import org.openmrs.test.Verifies;
+import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
+@SkipBaseSetup
public class EncounterCohortDefinitionEvaluatorTest extends BaseModuleContextSensitiveTest {
protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/";
protected static final String XML_REPORT_TEST_DATASET = "ReportTestDataset";
- @Before
+ @BeforeEach
public void setup() throws Exception {
+ initializeInMemoryDatabase();
+ authenticate();
executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET));
}
@@ -201,7 +205,7 @@ public void evaluate_shouldReturnCorrectPatientsWhenTimeQualifierParametersAreSe
* @see EncounterCohortDefinitionEvaluator#evaluate(CohortDefinition,EvaluationContext)
* @verifies return correct patients when provider parameters are set
*/
- @Ignore
+ @Disabled
@Test
public void evaluate_shouldReturnCorrectPatientsWhenProviderParametersAreSet() throws Exception {
EncounterCohortDefinition cd = new EncounterCohortDefinition();
@@ -212,7 +216,7 @@ public void evaluate_shouldReturnCorrectPatientsWhenProviderParametersAreSet() t
/**
* @see {@link EncounterCohortDefinitionEvaluator#evaluate(CohortDefinition,EvaluationContext)}
*/
- @Ignore
+ @Disabled
@Test
@Verifies(value = "should not return voided patients", method = "evaluate(CohortDefinition,EvaluationContext)")
public void evaluate_shouldNotReturnVoidedPatients() throws Exception {
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluatorTest.java
index 87d3dc7669..12db3e1db6 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluatorTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluatorTest.java
@@ -68,7 +68,7 @@ public void setUp() throws Exception {
@Test
public void testEvaluateWithNoProperties() throws Exception {
Cohort c = cohortDefinitionService.evaluate(cd, null);
- assertThat(c.size(), is(2));
+ assertThat(c.size(), is(3));
}
@Test
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java
index c6661638c0..22a48c0a03 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java
@@ -12,17 +12,14 @@
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.openmrs.api.context.Context;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
+import org.openmrs.test.SkipBaseSetup;
+import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(Context.class)
-public class PrivilegedDataConverterTest {
+@SkipBaseSetup
+public class PrivilegedDataConverterTest extends BaseModuleContextSensitiveTest {
public static final String INPUT = "input";
public static final String REPLACEMENT = "****";
@@ -30,18 +27,24 @@ public class PrivilegedDataConverterTest {
public static final String HAS_PRIV = "A privilege I have";
public static final String DOES_NOT_HAVE_PRIV = "A privilege I do not have";
- @Before
+ @BeforeEach
public void setUp() throws Exception {
- PowerMockito.mockStatic(Context.class);
- PowerMockito.when(Context.hasPrivilege(HAS_PRIV)).thenReturn(true);
- PowerMockito.when(Context.hasPrivilege(DOES_NOT_HAVE_PRIV)).thenReturn(false);
+ initializeInMemoryDatabase();
+ executeDataSet("org/openmrs/module/reporting/include/PrivilegeTest.xml");
}
@Test
- public void testConvertWithPrivilege() throws Exception {
- PrivilegedDataConverter converter = new PrivilegedDataConverter(HAS_PRIV);
- converter.setReplacement(REPLACEMENT);
- assertThat((String) converter.convert(INPUT), is(INPUT));
+ public void testConvertWithPrivilege() {
+ try {
+ Context.addProxyPrivilege(HAS_PRIV);
+ Context.hasPrivilege(HAS_PRIV);
+ PrivilegedDataConverter converter = new PrivilegedDataConverter(HAS_PRIV);
+ converter.setReplacement(REPLACEMENT);
+ assertThat((String) converter.convert(INPUT), is(INPUT));
+ }
+ finally {
+ Context.removeProxyPrivilege(HAS_PRIV);
+ }
}
@Test
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java
index 4cd21f1535..ddf17348c8 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java
@@ -10,8 +10,8 @@
package org.openmrs.module.reporting.data.patient.service;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.openmrs.Cohort;
import org.openmrs.Patient;
import org.openmrs.PersonAttribute;
@@ -31,10 +31,10 @@
import org.openmrs.module.reporting.definition.library.DocumentedDefinition;
import org.openmrs.module.reporting.evaluation.EvaluationContext;
import org.openmrs.test.BaseContextSensitiveTest;
-import org.openmrs.test.BaseModuleContextSensitiveTest;
+import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.Arrays;
+import java.util.Collections;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.nullValue;
@@ -59,7 +59,7 @@ public class PatientDataServiceImplTest extends BaseModuleContextSensitiveTest {
*
* @throws Exception
*/
- @Before
+ @BeforeEach
public void setup() throws Exception {
executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET));
}
@@ -159,7 +159,7 @@ private CohortDefinition setUpTestPatientCohortDefinition(PersonAttributeType te
PersonAttributeCohortDefinition cohortDefinition = new PersonAttributeCohortDefinition();
cohortDefinition.setName("Test Patients");
cohortDefinition.setAttributeType(testAttributeType);
- cohortDefinition.setValues(Arrays.asList("true"));
+ cohortDefinition.setValues(Collections.singletonList("true"));
Context.getService(CohortDefinitionService.class).saveDefinition(cohortDefinition);
return cohortDefinition;
}
@@ -199,7 +199,7 @@ public String getKeyPrefix() {
public CohortDefinition getTestPatients() {
PersonAttributeCohortDefinition cohortDefinition = new PersonAttributeCohortDefinition();
cohortDefinition.setAttributeType(Context.getPersonService().getPersonAttributeTypeByUuid(TEST_PATIENT_ATTR_TYPE_UUID));
- cohortDefinition.setValues(Arrays.asList("true"));
+ cohortDefinition.setValues(Collections.singletonList("true"));
return cohortDefinition;
}
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java
index 5bc097b695..f5815de1a0 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java
@@ -10,8 +10,8 @@
package org.openmrs.module.reporting.data.visit.evaluator;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.openmrs.Cohort;
import org.openmrs.api.context.Context;
import org.openmrs.module.reporting.common.TestUtil;
@@ -21,9 +21,11 @@
import org.openmrs.module.reporting.evaluation.EvaluationContext;
import org.openmrs.module.reporting.evaluation.context.VisitEvaluationContext;
import org.openmrs.module.reporting.query.visit.VisitIdSet;
-import org.openmrs.test.BaseModuleContextSensitiveTest;
+import org.openmrs.test.SkipBaseSetup;
+import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
-public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest{
+@SkipBaseSetup
+public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest {
protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/";
@@ -35,8 +37,10 @@ public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest{
*
* @throws Exception
*/
- @Before
+ @BeforeEach
public void setup() throws Exception {
+ initializeInMemoryDatabase();
+ authenticate();
executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET));
}
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluatorTest.java
index 41e2df6356..c99debd6f5 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluatorTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluatorTest.java
@@ -30,8 +30,8 @@
import java.util.HashMap;
import java.util.Map;
-import static org.mockito.Matchers.argThat;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.argThat;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java
index 39192f318b..786c3fa0c3 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java
@@ -9,25 +9,23 @@
*/
package org.openmrs.module.reporting.evaluation;
-import static org.junit.Assume.assumeTrue;
-
import org.apache.log4j.Appender;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.WriterAppender;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.openmrs.api.context.Context;
import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition;
import org.openmrs.module.reporting.indicator.CohortIndicator;
import org.openmrs.module.reporting.indicator.service.IndicatorService;
import org.openmrs.module.reporting.test.OpenmrsVersionTestListener;
import org.openmrs.module.reporting.test.RequiresVersion;
-import org.openmrs.test.BaseModuleContextSensitiveTest;
+import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
import org.springframework.test.context.TestExecutionListeners;
import java.io.StringWriter;
@@ -52,7 +50,7 @@ public class EvaluationProfilerTest extends BaseModuleContextSensitiveTest {
/**
* Setup each test by configuring AOP on the relevant services and logging for the profiler class
*/
- @Before
+ @BeforeEach
public void setup() {
profiler1 = new EvaluationProfiler(new EvaluationContext());
profiler2 = new EvaluationProfiler(new EvaluationContext());
@@ -70,7 +68,7 @@ public void setup() {
/**
* Cleanup after tests by removing AOP and resetting logging
*/
- @After
+ @AfterEach
public void cleanup() {
logger.setLevel(startingLevel);
for (Appender appender : startingAppenders) {
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest24On.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest24On.java
index 5d98991313..a4edf82f44 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest24On.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest24On.java
@@ -15,13 +15,14 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.openmrs.api.context.Context;
+import org.openmrs.logging.MemoryAppender;
+import org.openmrs.logging.OpenmrsLoggingUtil;
import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition;
import org.openmrs.module.reporting.indicator.CohortIndicator;
import org.openmrs.module.reporting.indicator.service.IndicatorService;
import org.openmrs.module.reporting.test.OpenmrsVersionTestListener;
import org.openmrs.module.reporting.test.RequiresVersion;
import org.openmrs.test.BaseModuleContextSensitiveTest;
-import org.openmrs.util.MemoryAppender;
import org.openmrs.util.OpenmrsUtil;
import org.springframework.test.context.TestExecutionListeners;
@@ -38,7 +39,7 @@ public class EvaluationProfilerTest24On extends BaseModuleContextSensitiveTest {
@BeforeClass
public static void beforeClass() {
- appender = OpenmrsUtil.getMemoryAppender();
+ appender = OpenmrsLoggingUtil.getMemoryAppender();
if (appender == null) {
LoggerContext context = (LoggerContext) LogManager.getContext(false);
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersObsQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersObsQueryEvaluatorTest.java
index 091968460d..d50fce7ca2 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersObsQueryEvaluatorTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersObsQueryEvaluatorTest.java
@@ -9,8 +9,8 @@
*/
package org.openmrs.module.reporting.query.encounter.evaluator;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.openmrs.api.context.Context;
import org.openmrs.module.reporting.common.DateUtil;
import org.openmrs.module.reporting.common.TestUtil;
@@ -20,7 +20,8 @@
import org.openmrs.module.reporting.query.obs.definition.BasicObsQuery;
import org.openmrs.module.reporting.query.obs.definition.MappedParametersObsQuery;
import org.openmrs.module.reporting.query.obs.service.ObsQueryService;
-import org.openmrs.test.BaseModuleContextSensitiveTest;
+import org.openmrs.test.SkipBaseSetup;
+import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
import java.util.Date;
import java.util.HashMap;
@@ -30,14 +31,17 @@
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+@SkipBaseSetup
public class MappedParametersObsQueryEvaluatorTest extends BaseModuleContextSensitiveTest {
protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/";
protected static final String XML_REPORT_TEST_DATASET = "ReportTestDataset";
- @Before
+ @BeforeEach
public void setup() throws Exception {
+ initializeInMemoryDatabase();
+ authenticate();
executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET));
}
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java
index 1df50abe27..783385ad97 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java
@@ -12,8 +12,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.openmrs.Cohort;
import org.openmrs.api.context.Context;
import org.openmrs.module.reporting.common.TestUtil;
@@ -23,17 +23,21 @@
import org.openmrs.module.reporting.query.obs.ObsQueryResult;
import org.openmrs.module.reporting.query.obs.definition.SqlObsQuery;
import org.openmrs.module.reporting.query.obs.service.ObsQueryService;
-import org.openmrs.test.BaseModuleContextSensitiveTest;
+import org.openmrs.test.SkipBaseSetup;
+import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
/**
* Test the evaluation of the SqlObsQuery
*/
+@SkipBaseSetup
public class SqlObsQueryEvaluatorTest extends BaseModuleContextSensitiveTest {
protected static Log log = LogFactory.getLog(SqlObsQueryEvaluatorTest.class);
- @Before
+ @BeforeEach
public void setup() throws Exception {
+ initializeInMemoryDatabase();
+ authenticate();
executeDataSet("org/openmrs/module/reporting/include/" + new TestUtil().getTestDatasetFilename("ReportTestDataset"));
}
diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluatorTest.java
index 4c7b12ca68..1f7f83f632 100644
--- a/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluatorTest.java
+++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluatorTest.java
@@ -9,8 +9,8 @@
*/
package org.openmrs.module.reporting.query.visit.evaluator;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.openmrs.Patient;
import org.openmrs.Visit;
import org.openmrs.api.VisitService;
@@ -22,7 +22,8 @@
import org.openmrs.module.reporting.query.visit.VisitQueryResult;
import org.openmrs.module.reporting.query.visit.definition.ActiveVisitQuery;
import org.openmrs.module.reporting.query.visit.service.VisitQueryService;
-import org.openmrs.test.BaseModuleContextSensitiveTest;
+import org.openmrs.test.SkipBaseSetup;
+import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
@@ -32,6 +33,7 @@
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
import static org.junit.Assert.assertThat;
+@SkipBaseSetup
public class ActiveVisitQueryEvaluatorTest extends BaseModuleContextSensitiveTest {
protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/";
@@ -47,8 +49,10 @@ public class ActiveVisitQueryEvaluatorTest extends BaseModuleContextSensitiveTes
@Autowired
private TestDataManager data;
- @Before
+ @BeforeEach
public void setup() throws Exception {
+ initializeInMemoryDatabase();
+ authenticate();
executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET));
}
diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/PrivilegeTest.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/PrivilegeTest.xml
new file mode 100644
index 0000000000..7444951a19
--- /dev/null
+++ b/api-tests/src/test/resources/org/openmrs/module/reporting/include/PrivilegeTest.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.4.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.7.xml
similarity index 100%
rename from api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.4.xml
rename to api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.7.xml
diff --git a/api/pom.xml b/api/pom.xml
index b86abc6d1b..10190d27ba 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -3,7 +3,7 @@
org.openmrs.module
reporting
- 1.29.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
reporting-api
jar
@@ -11,5 +11,4 @@
API project for Reporting
-
diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java
index 58b63e19f2..c356f07150 100644
--- a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java
+++ b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java
@@ -20,6 +20,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.api.context.Context;
+import org.openmrs.module.reporting.cohort.definition.CohortDefinition;
+import org.openmrs.module.reporting.dataset.definition.CohortIndicatorAndDimensionDataSetDefinition;
+import org.openmrs.module.reporting.evaluation.parameter.Mapped;
+import org.openmrs.module.reporting.evaluation.parameter.Parameter;
+import org.openmrs.module.reporting.report.definition.ReportDefinition;
import org.openmrs.module.serialization.xstream.XStreamShortSerializer;
import org.openmrs.module.serialization.xstream.mapper.CGLibMapper;
import org.openmrs.module.serialization.xstream.mapper.HibernateCollectionMapper;
@@ -88,6 +93,7 @@ public Object unmarshal(HierarchicalStreamReader reader, Object root) {
xstream.registerConverter(new IndicatorConverter(mapper, converterLookup));
xstream.registerConverter(new ReportDefinitionConverter(mapper, converterLookup));
+ xstream.allowTypes(new Class[] {Parameter.class, Mapped.class, CohortIndicatorAndDimensionDataSetDefinition.CohortIndicatorAndDimensionSpecification.class});
}
@Override
diff --git a/api/src/main/resources/moduleApplicationContext.xml b/api/src/main/resources/moduleApplicationContext.xml
index 38a380a90d..2213b24170 100644
--- a/api/src/main/resources/moduleApplicationContext.xml
+++ b/api/src/main/resources/moduleApplicationContext.xml
@@ -41,7 +41,7 @@
-
+
diff --git a/omod/pom.xml b/omod/pom.xml
index 55f0dbf714..f3ac72d6fd 100644
--- a/omod/pom.xml
+++ b/omod/pom.xml
@@ -3,7 +3,7 @@
org.openmrs.module
reporting
- 1.29.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
reporting-omod
jar
diff --git a/omod/src/main/resources/config.xml b/omod/src/main/resources/config.xml
index 5f1c34c3ec..fe403b3391 100644
--- a/omod/src/main/resources/config.xml
+++ b/omod/src/main/resources/config.xml
@@ -178,4 +178,5 @@
ReportRequest.hbm.xml
+
diff --git a/pom.xml b/pom.xml
index 40142027ed..81f5034620 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.openmrs.module
reporting
- 1.29.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
pom
Reporting
Parent project for Reporting
@@ -38,17 +38,16 @@
- 2.4.1
- 2.4
- 1.7.2
- 0.2.14
+ 2.7.0
+ 2.7
+ 2.0.0-SNAPSHOT
+ 0.2.17-SNAPSHOT
1.2
2.1.1
3.12
- 1.8.7
- 2.12.5
- 1.1.2
- 1.7.0
+ 2.12.5
+ 1.1.2
+ 1.7.0
UTF-8
${project.parent.artifactId}
Reporting
@@ -99,15 +98,6 @@
-
-
- org.codehaus.groovy
- groovy-all
- ${groovyVersion}
- jar
- provided
-
-
joda-time
joda-time
@@ -208,27 +198,6 @@
provided
-
- org.openmrs.module
- serialization.xstream-api-1.9
- ${serializationVersion}
- provided
-
-
-
- org.openmrs.module
- serialization.xstream-api-1.10
- ${serializationVersion}
- provided
-
-
-
- org.openmrs.module
- serialization.xstream-api-2.0
- ${serializationVersion}
- provided
-
-
org.openmrs.module
htmlwidgets-api