#fixed code
                                @Test
    public void processReportWithOptions()
        throws IOException
    {

        WebClient client = WebClient.create( BASE_ADDRESS );
        client.path( "processReport" );
        client.accept( MediaType.APPLICATION_XML );

        ReportAndDataRepresentation report = new ReportAndDataRepresentation();

        InputStream in = RESTXDocReportServiceTest.class.getClassLoader().getResourceAsStream( "bo.docx" );
        report.setReportID( "reportID1" );
        report.setDocument( fr.opensagres.xdocreport.core.io.IOUtils.toByteArray( in ) );
        report.setTemplateEngine( "Velocity" );
        report.getFieldsMetaData().add( "test" );
        report.setTemplateEngine( "Velocity" );

        report.setDataContext( new ArrayList<DataContext>() );

        WSOptions options = new WSOptions();
        options.setFrom( DocumentKind.DOCX.name() );
        options.setTo( ConverterTypeTo.PDF.name() );
        options.setVia( ConverterTypeVia.ITEXT.name() );

        report.setOptions( options );
        //client.post( report);
        byte[] flux= client.post( report,byte[].class );
        assertNotNull(flux);
//
//        File aFile= new File( "target/result.pdf");
//        FileOutputStream fos= new FileOutputStream( aFile );
//        fos.write( flux );
//        fos.close();
    }
#vulnerable code 
                                @Test
    public void processReportWithOptions()
        throws IOException
    {

        WebClient client = WebClient.create( BASE_ADDRESS );
        client.path( "processReport" );
        client.accept( MediaType.APPLICATION_XML );

        ReportAndDataRepresentation report = new ReportAndDataRepresentation();

        InputStream in = RESTXDocReportServiceTest.class.getClassLoader().getResourceAsStream( "bo.docx" );
        report.setReportID( "reportID1" );
        report.setDocument( fr.opensagres.xdocreport.core.io.IOUtils.toByteArray( in ) );
        report.setTemplateEngine( "Velocity" );
        report.getFieldsMetaData().add( "test" );
        report.setTemplateEngine( "Velocity" );

        report.setDataContext( new ArrayList<DataContext>() );

        WSOptions options = new WSOptions();
        options.setFrom( DocumentKind.DOCX.name() );
        options.setTo( ConverterTypeTo.PDF.name() );
        options.setVia( ConverterTypeVia.ITEXT.name() );

        report.setOptions( options );
        //client.post( report);
        byte[] flux= client.post( report,byte[].class );
        assertNotNull(flux);

        File aFile= new File( "result.pdf");
        FileOutputStream fos= new FileOutputStream( aFile );
        fos.write( flux );
        fos.close();
    } 
                            #location 35 
                            #vulnerability type RESOURCE_LEAK