From: Dominik Stadler Date: Fri, 29 Jul 2022 18:27:49 +0000 (+0000) Subject: Change test to make it work with JDK 19+ X-Git-Tag: REL_5_2_3~103 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3f0afe8fc78e43ff327d7561a0d61d9a824b0be7;p=poi.git Change test to make it work with JDK 19+ This way of mocking does not work any more with JDK 19+ git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903111 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java b/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java index 16e088087c..6c9f08705d 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java @@ -33,9 +33,6 @@ import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; public class TestArcTo { @@ -129,22 +126,16 @@ public class TestArcTo { // classes into poi-ooxml-lite @Test public void testSnapshot() { - SectionType sectionType = mock(SectionType.class); - RowType rowType = mock(RowType.class); - - when(sectionType.getCellArray()).thenReturn(new CellType[0]); - when(sectionType.getRowArray()).thenReturn(new RowType[] { - rowType - }); - when(rowType.getIX()).thenReturn(0L); - when(rowType.getT()).thenReturn("ArcTo"); - when(rowType.getCellArray()).thenReturn(new CellType[0]); + SectionType sectionType = SectionType.Factory.newInstance(); GeometrySection section = new GeometrySection(sectionType, null); assertNotNull(section); TriggerType[] triggerArray = sectionType.getTriggerArray(); - assertNull(triggerArray); + assertNotNull(triggerArray); + + RowType[] rowArray = sectionType.getRowArray(); + assertNotNull(rowArray); } private static ArcTo createArcTo(double a) {