Hello Aspose Team,
Is there any possibility to mock the Document object using Junit/Mokito?
Something like
@Test
public void processFileValid() throws Exception {
Document mockMainDoc = Mockito.mock(Document.class);
Mockito.when(mockMainDoc.save(Mockito.anyString())).thenReturn(null);
String processFile = cerAsposeService.processFile(mockMainDoc);
Assert.assertNotNull(processFile);
}
I am getting Exception when i use the above code :
java.lang.IllegalArgumentException: Specified argument was out of the range of valid values.Parameter name: sectionIdx
at com.aspose.words.DocumentBuilder.zzO(Unknown Source)
at com.aspose.words.DocumentBuilder.moveToDocumentStart(Unknown Source)
at com.aspose.words.DocumentBuilder.setDocument(Unknown Source)
at com.aspose.words.DocumentBuilder.<init>(Unknown Source)
Please do let me know if there are other alternatives.