Author: centic
Date: Fri Jul 29 18:27:49 2022
New Revision: 1903111
URL: http://svn.apache.org/viewvc?rev=1903111&view=rev
Log:
Change test to make it work with JDK 19+
This way of mocking does not work any more with JDK 19+
Modified:
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java
Modified:
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java
URL:
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java?rev=1903111&r1=1903110&r2=1903111&view=diff
==============================================================================
---
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java
(original)
+++
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xdgf/usermodel/section/geometry/TestArcTo.java
Fri Jul 29 18:27:49 2022
@@ -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) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]