Skip to content

Commit

Permalink
fix jdk conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
vietnguyen committed May 16, 2024
1 parent 66a2ea5 commit ee7722c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ void testThatGetEventReportsDoesNotContainNewEventVisualizations() {
@Test
void testReportPdf() {
String body =
"""
{"name": "Name Test", "relativePeriods": {"last12Months": true},
"designContent": "<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?> <jasperReport xmlns=\\"http://jasperreports.sourceforge.net/jasperreports\\" xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xsi:schemaLocation=\\"http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd\\" name=\\"dpt\\" pageWidth=\\"595\\" pageHeight=\\"842\\" columnWidth=\\"555\\" leftMargin=\\"20\\" rightMargin=\\"20\\" topMargin=\\"20\\" bottomMargin=\\"20\\" uuid=\\"17839606-ae6d-42a7-8501-a4137adad2c1\\"> <property name=\\"ireport.zoom\\" value=\\"1.5\\"/> <property name=\\"ireport.x\\" value=\\"14\\"/> <property name=\\"ireport.y\\" value=\\"0\\"/> <field name=\\"organisationunitid\\" class=\\"java.lang.Integer\\"/> <field name=\\"organisationunitname\\" class=\\"java.lang.String\\"/> <field name=\\"reporting_month_name\\" class=\\"java.lang.String\\"/> <field name=\\"param_organisationunit_name\\" class=\\"java.lang.String\\"/> <field name=\\"organisation_unit_is_parent\\" class=\\"java.lang.String\\"/> <field name=\\"anc 1st visit_year\\" class=\\"java.lang.Double\\"/> <field name=\\"anc 2nd visit_year\\" class=\\"java.lang.Double\\"/> <field name=\\"anc 3rd visit_year\\" class=\\"java.lang.Double\\"/> <field name=\\"anc 4th or more_year\\" class=\\"java.lang.Double\\"/> <background> <band splitType=\\"Stretch\\"/> </background> <title> <band height=\\"326\\" splitType=\\"Stretch\\"> <staticText> <reportElement uuid=\\"1876010e-28c0-499a-bf70-aea9f6040d7b\\" x=\\"12\\" y=\\"15\\" width=\\"532\\" height=\\"41\\" forecolor=\\"#184F73\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"24\\"/> </textElement> <text><![CDATA[ANC Visits]]></text> </staticText> <bar3DChart> <chart evaluationTime=\\"Report\\"> <reportElement uuid=\\"fe511602-c6ba-4e97-a653-8acd9b61d305\\" x=\\"12\\" y=\\"114\\" width=\\"532\\" height=\\"210\\"/> <chartTitle/> <chartSubtitle/> <chartLegend/> </chart> <categoryDataset> <dataset> <incrementWhenExpression><![CDATA[$F{organisation_unit_is_parent}.equals( \\"Yes\\" )]]></incrementWhenExpression> </dataset> <categorySeries> <seriesExpression><![CDATA[\\"ANC 1st visit\\"]]></seriesExpression> <categoryExpression><![CDATA[\\"\\"]]></categoryExpression> <valueExpression><![CDATA[$F{anc 1st visit_year}]]></valueExpression> </categorySeries> <categorySeries> <seriesExpression><![CDATA[\\"ANC 2nd visit\\"]]></seriesExpression> <categoryExpression><![CDATA[\\"\\"]]></categoryExpression> <valueExpression><![CDATA[$F{anc 2nd visit_year}]]></valueExpression> </categorySeries> <categorySeries> <seriesExpression><![CDATA[\\"ANC 3rd visit\\"]]></seriesExpression> <categoryExpression><![CDATA[\\"\\"]]></categoryExpression> <valueExpression><![CDATA[$F{anc 3rd visit_year}]]></valueExpression> </categorySeries> <categorySeries> <seriesExpression><![CDATA[\\"ANC >=4 visits\\"]]></seriesExpression> <categoryExpression><![CDATA[\\"\\"]]></categoryExpression> <valueExpression><![CDATA[$F{anc 4th or more_year}]]></valueExpression> </categorySeries> </categoryDataset> <bar3DPlot isShowLabels=\\"true\\"> <plot/> <itemLabel color=\\"#000000\\" backgroundColor=\\"#FFFFFF\\"/> </bar3DPlot> </bar3DChart> <textField> <reportElement uuid=\\"0aeb7c9b-04ad-43d7-82e9-ca53dc04b3fc\\" x=\\"10\\" y=\\"68\\" width=\\"253\\" height=\\"20\\"/> <textElement textAlignment=\\"Right\\"> <font size=\\"13\\"/> </textElement> <textFieldExpression><![CDATA[$F{reporting_month_name}]]></textFieldExpression> </textField> <textField> <reportElement uuid=\\"a25c78a8-61a7-4003-a10f-1dbfbbdc43ac\\" x=\\"287\\" y=\\"68\\" width=\\"255\\" height=\\"20\\"/> <textElement> <font size=\\"13\\"/> </textElement> <textFieldExpression><![CDATA[$F{param_organisationunit_name}]]></textFieldExpression> </textField> <staticText> <reportElement uuid=\\"fb9533bc-db90-43bb-aad2-722abae6b51d\\" x=\\"263\\" y=\\"68\\" width=\\"24\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"13\\"/> </textElement> <text><![CDATA[-]]></text> </staticText> </band> </title> <pageHeader> <band height=\\"15\\" splitType=\\"Stretch\\"/> </pageHeader> <columnHeader> <band height=\\"51\\" splitType=\\"Stretch\\"> <staticText> <reportElement uuid=\\"6e085c2a-f2f0-4b51-951c-3d0f0a117a92\\" x=\\"89\\" y=\\"26\\" width=\\"129\\" height=\\"20\\"/> <textElement> <font size=\\"11\\" isBold=\\"true\\"/> </textElement> <text><![CDATA[Organisation unit]]></text> </staticText> <staticText> <reportElement uuid=\\"a575c888-3f49-4840-9aa3-0a84e6d35a78\\" x=\\"218\\" y=\\"26\\" width=\\"55\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"11\\" isBold=\\"true\\"/> </textElement> <text><![CDATA[ANC 1st visit]]></text> </staticText> <staticText> <reportElement uuid=\\"6f1d357d-5f36-4b1f-9a3a-0c8a51b318ec\\" x=\\"273\\" y=\\"26\\" width=\\"55\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"11\\" isBold=\\"true\\"/> </textElement> <text><![CDATA[ANC 2nd visit]]></text> </staticText> <staticText> <reportElement uuid=\\"a21c2500-87f5-4509-a766-dbdc9dcec98f\\" x=\\"328\\" y=\\"26\\" width=\\"55\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"11\\" isBold=\\"true\\"/> </textElement> <text><![CDATA[ANC 3rd visit]]></text> </staticText> <staticText> <reportElement uuid=\\"50047dbb-126f-4099-b49a-960e1cd09e33\\" x=\\"383\\" y=\\"26\\" width=\\"55\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"11\\" isBold=\\"true\\"/> </textElement> <text><![CDATA[ANC >=4 visits]]></text> </staticText> <line> <reportElement uuid=\\"43f67873-03e8-4b94-bca3-8882afbbad7e\\" x=\\"73\\" y=\\"45\\" width=\\"381\\" height=\\"1\\"/> </line> </band> </columnHeader> <detail> <band height=\\"21\\" splitType=\\"Stretch\\"> <textField isBlankWhenNull=\\"true\\"> <reportElement uuid=\\"8088fed7-0677-4ffd-8f04-0dbf5d39ad95\\" x=\\"89\\" y=\\"0\\" width=\\"129\\" height=\\"20\\"/> <textElement> <font size=\\"9\\"/> </textElement> <textFieldExpression><![CDATA[$F{organisationunitname}]]></textFieldExpression> </textField> <textField pattern=\\"###0\\" isBlankWhenNull=\\"true\\"> <reportElement uuid=\\"ee6ce247-f961-4b3f-ba8e-c98c9e6e33ab\\" x=\\"218\\" y=\\"0\\" width=\\"55\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"9\\"/> </textElement> <textFieldExpression><![CDATA[$F{anc 1st visit_year}]]></textFieldExpression> </textField> <textField pattern=\\"###0\\" isBlankWhenNull=\\"true\\"> <reportElement uuid=\\"ab1f1ec1-e403-48bf-a2fd-70b5fd73b3b3\\" x=\\"273\\" y=\\"0\\" width=\\"55\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"9\\"/> </textElement> <textFieldExpression><![CDATA[$F{anc 2nd visit_year}]]></textFieldExpression> </textField> <textField pattern=\\"###0\\" isBlankWhenNull=\\"true\\"> <reportElement uuid=\\"5ec61f4a-c211-4d92-b585-ed7310d33acc\\" x=\\"328\\" y=\\"0\\" width=\\"55\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"9\\"/> </textElement> <textFieldExpression><![CDATA[$F{anc 3rd visit_year}]]></textFieldExpression> </textField> <textField pattern=\\"###0\\" isBlankWhenNull=\\"true\\"> <reportElement uuid=\\"3ba05985-9b10-4ba0-9ef5-ab3aa00910cc\\" x=\\"383\\" y=\\"0\\" width=\\"55\\" height=\\"20\\"/> <textElement textAlignment=\\"Center\\"> <font size=\\"9\\"/> </textElement> <textFieldExpression><![CDATA[$F{anc 4th or more_year}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height=\\"22\\" splitType=\\"Stretch\\"/> </columnFooter> <pageFooter> <band height=\\"20\\" splitType=\\"Stretch\\"/> </pageFooter> <summary> <band height=\\"28\\" splitType=\\"Stretch\\"/> </summary> </jasperReport>"
}""";
"{\"name\": \"Name Test\", \"relativePeriods\": {\"last12Months\": true},\n"
+ "\"designContent\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?> <jasperReport xmlns=\\\"http://jasperreports.sourceforge.net/jasperreports\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd\\\" name=\\\"dpt\\\" pageWidth=\\\"595\\\" pageHeight=\\\"842\\\" columnWidth=\\\"555\\\" leftMargin=\\\"20\\\" rightMargin=\\\"20\\\" topMargin=\\\"20\\\" bottomMargin=\\\"20\\\" uuid=\\\"17839606-ae6d-42a7-8501-a4137adad2c1\\\"> <property name=\\\"ireport.zoom\\\" value=\\\"1.5\\\"/> <property name=\\\"ireport.x\\\" value=\\\"14\\\"/> <property name=\\\"ireport.y\\\" value=\\\"0\\\"/> <field name=\\\"organisationunitid\\\" class=\\\"java.lang.Integer\\\"/> <field name=\\\"organisationunitname\\\" class=\\\"java.lang.String\\\"/> <field name=\\\"reporting_month_name\\\" class=\\\"java.lang.String\\\"/> <field name=\\\"param_organisationunit_name\\\" class=\\\"java.lang.String\\\"/> <field name=\\\"organisation_unit_is_parent\\\" class=\\\"java.lang.String\\\"/> <field name=\\\"anc 1st visit_year\\\" class=\\\"java.lang.Double\\\"/> <field name=\\\"anc 2nd visit_year\\\" class=\\\"java.lang.Double\\\"/> <field name=\\\"anc 3rd visit_year\\\" class=\\\"java.lang.Double\\\"/> <field name=\\\"anc 4th or more_year\\\" class=\\\"java.lang.Double\\\"/> <background> <band splitType=\\\"Stretch\\\"/> </background> <title> <band height=\\\"326\\\" splitType=\\\"Stretch\\\"> <staticText> <reportElement uuid=\\\"1876010e-28c0-499a-bf70-aea9f6040d7b\\\" x=\\\"12\\\" y=\\\"15\\\" width=\\\"532\\\" height=\\\"41\\\" forecolor=\\\"#184F73\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"24\\\"/> </textElement> <text><![CDATA[ANC Visits]]></text> </staticText> <bar3DChart> <chart evaluationTime=\\\"Report\\\"> <reportElement uuid=\\\"fe511602-c6ba-4e97-a653-8acd9b61d305\\\" x=\\\"12\\\" y=\\\"114\\\" width=\\\"532\\\" height=\\\"210\\\"/> <chartTitle/> <chartSubtitle/> <chartLegend/> </chart> <categoryDataset> <dataset> <incrementWhenExpression><![CDATA[$F{organisation_unit_is_parent}.equals( \\\"Yes\\\" )]]></incrementWhenExpression> </dataset> <categorySeries> <seriesExpression><![CDATA[\\\"ANC 1st visit\\\"]]></seriesExpression> <categoryExpression><![CDATA[\\\"\\\"]]></categoryExpression> <valueExpression><![CDATA[$F{anc 1st visit_year}]]></valueExpression> </categorySeries> <categorySeries> <seriesExpression><![CDATA[\\\"ANC 2nd visit\\\"]]></seriesExpression> <categoryExpression><![CDATA[\\\"\\\"]]></categoryExpression> <valueExpression><![CDATA[$F{anc 2nd visit_year}]]></valueExpression> </categorySeries> <categorySeries> <seriesExpression><![CDATA[\\\"ANC 3rd visit\\\"]]></seriesExpression> <categoryExpression><![CDATA[\\\"\\\"]]></categoryExpression> <valueExpression><![CDATA[$F{anc 3rd visit_year}]]></valueExpression> </categorySeries> <categorySeries> <seriesExpression><![CDATA[\\\"ANC >=4 visits\\\"]]></seriesExpression> <categoryExpression><![CDATA[\\\"\\\"]]></categoryExpression> <valueExpression><![CDATA[$F{anc 4th or more_year}]]></valueExpression> </categorySeries> </categoryDataset> <bar3DPlot isShowLabels=\\\"true\\\"> <plot/> <itemLabel color=\\\"#000000\\\" backgroundColor=\\\"#FFFFFF\\\"/> </bar3DPlot> </bar3DChart> <textField> <reportElement uuid=\\\"0aeb7c9b-04ad-43d7-82e9-ca53dc04b3fc\\\" x=\\\"10\\\" y=\\\"68\\\" width=\\\"253\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Right\\\"> <font size=\\\"13\\\"/> </textElement> <textFieldExpression><![CDATA[$F{reporting_month_name}]]></textFieldExpression> </textField> <textField> <reportElement uuid=\\\"a25c78a8-61a7-4003-a10f-1dbfbbdc43ac\\\" x=\\\"287\\\" y=\\\"68\\\" width=\\\"255\\\" height=\\\"20\\\"/> <textElement> <font size=\\\"13\\\"/> </textElement> <textFieldExpression><![CDATA[$F{param_organisationunit_name}]]></textFieldExpression> </textField> <staticText> <reportElement uuid=\\\"fb9533bc-db90-43bb-aad2-722abae6b51d\\\" x=\\\"263\\\" y=\\\"68\\\" width=\\\"24\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"13\\\"/> </textElement> <text><![CDATA[-]]></text> </staticText> </band> </title> <pageHeader> <band height=\\\"15\\\" splitType=\\\"Stretch\\\"/> </pageHeader> <columnHeader> <band height=\\\"51\\\" splitType=\\\"Stretch\\\"> <staticText> <reportElement uuid=\\\"6e085c2a-f2f0-4b51-951c-3d0f0a117a92\\\" x=\\\"89\\\" y=\\\"26\\\" width=\\\"129\\\" height=\\\"20\\\"/> <textElement> <font size=\\\"11\\\" isBold=\\\"true\\\"/> </textElement> <text><![CDATA[Organisation unit]]></text> </staticText> <staticText> <reportElement uuid=\\\"a575c888-3f49-4840-9aa3-0a84e6d35a78\\\" x=\\\"218\\\" y=\\\"26\\\" width=\\\"55\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"11\\\" isBold=\\\"true\\\"/> </textElement> <text><![CDATA[ANC 1st visit]]></text> </staticText> <staticText> <reportElement uuid=\\\"6f1d357d-5f36-4b1f-9a3a-0c8a51b318ec\\\" x=\\\"273\\\" y=\\\"26\\\" width=\\\"55\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"11\\\" isBold=\\\"true\\\"/> </textElement> <text><![CDATA[ANC 2nd visit]]></text> </staticText> <staticText> <reportElement uuid=\\\"a21c2500-87f5-4509-a766-dbdc9dcec98f\\\" x=\\\"328\\\" y=\\\"26\\\" width=\\\"55\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"11\\\" isBold=\\\"true\\\"/> </textElement> <text><![CDATA[ANC 3rd visit]]></text> </staticText> <staticText> <reportElement uuid=\\\"50047dbb-126f-4099-b49a-960e1cd09e33\\\" x=\\\"383\\\" y=\\\"26\\\" width=\\\"55\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"11\\\" isBold=\\\"true\\\"/> </textElement> <text><![CDATA[ANC >=4 visits]]></text> </staticText> <line> <reportElement uuid=\\\"43f67873-03e8-4b94-bca3-8882afbbad7e\\\" x=\\\"73\\\" y=\\\"45\\\" width=\\\"381\\\" height=\\\"1\\\"/> </line> </band> </columnHeader> <detail> <band height=\\\"21\\\" splitType=\\\"Stretch\\\"> <textField isBlankWhenNull=\\\"true\\\"> <reportElement uuid=\\\"8088fed7-0677-4ffd-8f04-0dbf5d39ad95\\\" x=\\\"89\\\" y=\\\"0\\\" width=\\\"129\\\" height=\\\"20\\\"/> <textElement> <font size=\\\"9\\\"/> </textElement> <textFieldExpression><![CDATA[$F{organisationunitname}]]></textFieldExpression> </textField> <textField pattern=\\\"###0\\\" isBlankWhenNull=\\\"true\\\"> <reportElement uuid=\\\"ee6ce247-f961-4b3f-ba8e-c98c9e6e33ab\\\" x=\\\"218\\\" y=\\\"0\\\" width=\\\"55\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"9\\\"/> </textElement> <textFieldExpression><![CDATA[$F{anc 1st visit_year}]]></textFieldExpression> </textField> <textField pattern=\\\"###0\\\" isBlankWhenNull=\\\"true\\\"> <reportElement uuid=\\\"ab1f1ec1-e403-48bf-a2fd-70b5fd73b3b3\\\" x=\\\"273\\\" y=\\\"0\\\" width=\\\"55\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"9\\\"/> </textElement> <textFieldExpression><![CDATA[$F{anc 2nd visit_year}]]></textFieldExpression> </textField> <textField pattern=\\\"###0\\\" isBlankWhenNull=\\\"true\\\"> <reportElement uuid=\\\"5ec61f4a-c211-4d92-b585-ed7310d33acc\\\" x=\\\"328\\\" y=\\\"0\\\" width=\\\"55\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"9\\\"/> </textElement> <textFieldExpression><![CDATA[$F{anc 3rd visit_year}]]></textFieldExpression> </textField> <textField pattern=\\\"###0\\\" isBlankWhenNull=\\\"true\\\"> <reportElement uuid=\\\"3ba05985-9b10-4ba0-9ef5-ab3aa00910cc\\\" x=\\\"383\\\" y=\\\"0\\\" width=\\\"55\\\" height=\\\"20\\\"/> <textElement textAlignment=\\\"Center\\\"> <font size=\\\"9\\\"/> </textElement> <textFieldExpression><![CDATA[$F{anc 4th or more_year}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height=\\\"22\\\" splitType=\\\"Stretch\\\"/> </columnFooter> <pageFooter> <band height=\\\"20\\\" splitType=\\\"Stretch\\\"/> </pageFooter> <summary> <band height=\\\"28\\\" splitType=\\\"Stretch\\\"/> </summary> </jasperReport>\"\n"
+ "}";
String uid = assertStatus(CREATED, POST("/reports/", body));
assertFalse(
GET("/reports/" + uid + "/data.pdf?t=1715330660314&ou=ImspTQPwCqd&pe=2023&date=2023-01-01")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.apache.struts2.ServletActionContext;
import org.hisp.dhis.util.ContextUtils;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.ChartUtils;
import org.jfree.chart.JFreeChart;

/**
Expand Down

0 comments on commit ee7722c

Please sign in to comment.