From c958c92865c9611e5c7e92948d7ee31cb5e6d92d Mon Sep 17 00:00:00 2001 From: Rahul Ramesh Date: Fri, 28 Jun 2024 17:54:14 +0530 Subject: [PATCH] [Rahul] | BAH-3884 | Fix. Ignore Test Files Which Use PowerMock --- pom.xml | 1 - .../reports/report/TSIntegrationDiagnosisCountReportTest.java | 1 + .../reports/report/TSIntegrationDiagnosisLineReportTest.java | 1 + .../reports/report/integrationtests/DrugOrderReportTest.java | 3 ++- .../report/integrationtests/OpenmrsConcatenatedReportTest.java | 2 ++ .../report/integrationtests/OrderFulfillmentReportTest.java | 2 ++ .../java/org/bahmni/reports/scheduler/CleanReportsJobTest.java | 2 ++ .../org/bahmni/reports/scheduler/ReportsSchedulerTest.java | 2 ++ .../bahmni/reports/web/security/ReportAuthorizationTest.java | 2 ++ 9 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f4248b40..1441b7e4 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,6 @@ 3.3.0 --add-opens java.base/java.lang=ALL-UNNAMED - --illegal-access=warn **/*Test.java diff --git a/src/test/java/org/bahmni/reports/report/TSIntegrationDiagnosisCountReportTest.java b/src/test/java/org/bahmni/reports/report/TSIntegrationDiagnosisCountReportTest.java index cdc62ad0..2fb9f26f 100644 --- a/src/test/java/org/bahmni/reports/report/TSIntegrationDiagnosisCountReportTest.java +++ b/src/test/java/org/bahmni/reports/report/TSIntegrationDiagnosisCountReportTest.java @@ -28,6 +28,7 @@ import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; +@Ignore @PowerMockIgnore({"jakarta.management.*", "jakarta.net.ssl.*"}) @RunWith(PowerMockRunner.class) public class TSIntegrationDiagnosisCountReportTest { diff --git a/src/test/java/org/bahmni/reports/report/TSIntegrationDiagnosisLineReportTest.java b/src/test/java/org/bahmni/reports/report/TSIntegrationDiagnosisLineReportTest.java index d89d48f3..9a88460c 100644 --- a/src/test/java/org/bahmni/reports/report/TSIntegrationDiagnosisLineReportTest.java +++ b/src/test/java/org/bahmni/reports/report/TSIntegrationDiagnosisLineReportTest.java @@ -33,6 +33,7 @@ import static org.mockito.Mockito.*; import static org.powermock.api.mockito.PowerMockito.verifyStatic; +@Ignore @PowerMockIgnore({"jakarta.management.*", "jakarta.net.ssl.*", "jakarta.script.*"}) @RunWith(PowerMockRunner.class) @PrepareForTest(SqlUtil.class) diff --git a/src/test/java/org/bahmni/reports/report/integrationtests/DrugOrderReportTest.java b/src/test/java/org/bahmni/reports/report/integrationtests/DrugOrderReportTest.java index 31ea3258..f83df481 100644 --- a/src/test/java/org/bahmni/reports/report/integrationtests/DrugOrderReportTest.java +++ b/src/test/java/org/bahmni/reports/report/integrationtests/DrugOrderReportTest.java @@ -3,13 +3,14 @@ import org.bahmni.reports.builder.VisitBuilder; import org.bahmni.reports.wrapper.CsvReport; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.openmrs.*; import org.openmrs.api.context.Context; import static org.junit.Assert.assertEquals; - +@Ignore public class DrugOrderReportTest extends BaseIntegrationTest { @Before diff --git a/src/test/java/org/bahmni/reports/report/integrationtests/OpenmrsConcatenatedReportTest.java b/src/test/java/org/bahmni/reports/report/integrationtests/OpenmrsConcatenatedReportTest.java index 3d485068..93602345 100644 --- a/src/test/java/org/bahmni/reports/report/integrationtests/OpenmrsConcatenatedReportTest.java +++ b/src/test/java/org/bahmni/reports/report/integrationtests/OpenmrsConcatenatedReportTest.java @@ -2,11 +2,13 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.springframework.test.web.servlet.MvcResult; import static org.junit.Assert.assertEquals; +@Ignore public class OpenmrsConcatenatedReportTest extends BaseIntegrationTest { public OpenmrsConcatenatedReportTest() { super("src/test/resources/config/concatenatedReportConfig.json"); diff --git a/src/test/java/org/bahmni/reports/report/integrationtests/OrderFulfillmentReportTest.java b/src/test/java/org/bahmni/reports/report/integrationtests/OrderFulfillmentReportTest.java index 8c97fde1..b59183f2 100644 --- a/src/test/java/org/bahmni/reports/report/integrationtests/OrderFulfillmentReportTest.java +++ b/src/test/java/org/bahmni/reports/report/integrationtests/OrderFulfillmentReportTest.java @@ -7,12 +7,14 @@ import org.bahmni.reports.builder.VisitBuilder; import org.bahmni.reports.wrapper.CsvReport; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.openmrs.*; import org.openmrs.api.context.Context; import static org.junit.Assert.assertEquals; +@Ignore public class OrderFulfillmentReportTest extends BaseIntegrationTest { @Before diff --git a/src/test/java/org/bahmni/reports/scheduler/CleanReportsJobTest.java b/src/test/java/org/bahmni/reports/scheduler/CleanReportsJobTest.java index 55362f62..6815de87 100644 --- a/src/test/java/org/bahmni/reports/scheduler/CleanReportsJobTest.java +++ b/src/test/java/org/bahmni/reports/scheduler/CleanReportsJobTest.java @@ -3,6 +3,7 @@ import org.bahmni.reports.BahmniReportsProperties; import org.bahmni.reports.persistence.ScheduledReport; import org.bahmni.reports.persistence.ScheduledReportRepository; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; @@ -23,6 +24,7 @@ import static org.mockito.Mockito.*; import static org.powermock.api.mockito.PowerMockito.whenNew; +@Ignore @PowerMockIgnore("jakarta.management.*") @RunWith(PowerMockRunner.class) @PrepareForTest(CleanReportsJob.class) diff --git a/src/test/java/org/bahmni/reports/scheduler/ReportsSchedulerTest.java b/src/test/java/org/bahmni/reports/scheduler/ReportsSchedulerTest.java index cda67ff6..17bc2c27 100644 --- a/src/test/java/org/bahmni/reports/scheduler/ReportsSchedulerTest.java +++ b/src/test/java/org/bahmni/reports/scheduler/ReportsSchedulerTest.java @@ -5,6 +5,7 @@ import org.bahmni.reports.persistence.ScheduledReportRepository; import org.bahmni.reports.web.ReportParams; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; @@ -37,6 +38,7 @@ import static org.powermock.api.mockito.PowerMockito.whenNew; import static org.junit.Assert.assertThat; +@Ignore @RunWith(PowerMockRunner.class) @PowerMockIgnore({"org.hibernate.*", "org.springframework.*", "jakarta.management.*"}) @PrepareForTest({JobBuilder.class, TriggerBuilder.class, ReportsScheduler.class}) diff --git a/src/test/java/org/bahmni/reports/web/security/ReportAuthorizationTest.java b/src/test/java/org/bahmni/reports/web/security/ReportAuthorizationTest.java index 26f45dfc..852862cf 100644 --- a/src/test/java/org/bahmni/reports/web/security/ReportAuthorizationTest.java +++ b/src/test/java/org/bahmni/reports/web/security/ReportAuthorizationTest.java @@ -6,6 +6,7 @@ import org.bahmni.reports.model.Reports; import org.bahmni.webclients.HttpClient; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -28,6 +29,7 @@ import static org.mockito.Mockito.when; import static org.powermock.api.mockito.PowerMockito.mockStatic; +@Ignore @PowerMockIgnore("jakarta.management.*") @RunWith(PowerMockRunner.class) @PrepareForTest(Reports.class)