/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.extension.internal;

import java.io.IOException;
import java.util.List;

import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.xwiki.extension.ExtensionLicense;
import org.xwiki.extension.ExtensionLicenseManager;
import org.xwiki.test.ComponentManagerRule;
import org.xwiki.test.annotation.ComponentList;

@ComponentList({
    DefaultExtensionLicenseManager.class
})
public class DefaultExtensionLicenseManagerTest
{
    @Rule
    public final ComponentManagerRule componentManager = new ComponentManagerRule();

    private ExtensionLicenseManager licenseManager;

    @Before
    public void setUp() throws Exception
    {
        this.licenseManager = this.componentManager.getInstance(ExtensionLicenseManager.class);
    }

    @Test
    public void testGetLicenses()
    {
        Assert.assertTrue(this.licenseManager.getLicenses().size() > 0);
    }

    @Test
    public void testGetLicense() throws IOException
    {
        ExtensionLicense license = this.licenseManager.getLicense("Apache License 2.0");

        List<String> content =
            IOUtils.readLines(getClass().getResourceAsStream("/extension/licenses/Apache License 2.0.license"));
        content = content.subList(4, content.size());

        Assert.assertNotNull(license);
        Assert.assertEquals("Apache License 2.0", license.getName());
        Assert.assertEquals(content, license.getContent());

        license = this.licenseManager.getLicense("ASL");

        Assert.assertNotNull(license);
        Assert.assertEquals("Apache License 2.0", license.getName());
        Assert.assertEquals(content, license.getContent());
    }
}

@@ -954,16 +954,58 @@
 eption;%0A
+import java.nio.charset.StandardCharsets;%0A
 import j
@@ -1360,20 +1360,16 @@
 ntList(%7B
-%0A   
  Default
@@ -1397,17 +1397,17 @@
 er.class
-%0A
+ 
 %7D)%0Apubli
@@ -2084,20 +2084,8 @@
 nt =
-%0A           
  IOU
@@ -2099,16 +2099,29 @@
 adLines(
+%0A            
 getClass
@@ -2192,16 +2192,40 @@
 icense%22)
+, StandardCharsets.UTF_8
 );%0A     
@@ -2257,9 +2257,9 @@
 ist(
-4
+8
 , co

Fix test