I have a requirement to upload a document to SharePoint by converting a .txt file to Excel and then send the document to a REST service by converting the excel into a byteArray.
The implementation was done and the code is working fine, however I have a written a simple Junit class which runs without any issue when I run as Junit but when I run my application as a maven build I am getting java.lang.OutOfMemoryError: PermGen space error. If I just ignore this test class the build is getting successful. I have no clues why this test class is causing the perm gen space issue.
I have tried increasing the perm gen space in environment variables, Maven pom.xml and eclipse configuration file but no luck.
Sample test case:
public void testUploadRenewalReportToSharePoint() throws Exception { InputStream inputStream = getClass().getClassLoader().getResourceAsStream("renewal_DOC1_log.txt"); byte[] byteArray = renewalLetterDoc1Service.generateRenewalReport(inputStream); assertEquals( "XXXX/RenewalReport_September_2017.xls", sharePointService.upload(byteArray, "RenewalReport_September_2017.xls").getPath()); } Could someone please help me root cause of the issue?