/*
 * 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.resource;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Unit tests for {@link org.xwiki.resource.AbstractResourceReference}.
 *
 * @version $Id$
 * @since 6.1M2
 */
public class AbstractResourceReferenceTest
{
    public class TestableResourceReference extends AbstractResourceReference
    {
    }

    @Test
    public void verifyToString()
    {
        TestableResourceReference reference = new TestableResourceReference();
        reference.setType(new ResourceType("test"));
        reference.addParameter("param1", "value1");

        assertEquals("type = [test], parameters = [[param1] = [[value1]]]", reference.toString());
    }
}

@@ -923,25 +923,63 @@
 %0Aimport 
-org.junit
+java.util.Arrays;%0A%0Aimport org.junit.jupiter.api
 .Test;%0A%0A
@@ -1006,14 +1006,30 @@
 nit.
+jupiter.api.
 Assert
+ions
 .ass
@@ -1280,24 +1280,167 @@
 rence%0A    %7B%0A
+        @Override%0A        public void setParameter(String name, Object value)%0A        %7B%0A            super.setParameter(name, value);%0A        %7D%0A
     %7D%0A%0A    @
@@ -1444,31 +1444,24 @@
   @Test%0A    
-public 
 void verifyT
@@ -1765,11 +1765,563 @@
 );%0A    %7D
+%0A%0A    @Test%0A    void setParameter()%0A    %7B%0A        TestableResourceReference reference = new TestableResourceReference();%0A        reference.addParameter(%22param%22, %22value1%22);%0A%0A        assertEquals(Arrays.asList(%22value1%22), reference.getParameterValues(%22param%22));%0A%0A        reference.addParameter(%22param%22, %22value2%22);%0A%0A        assertEquals(Arrays.asList(%22value1%22, %22value2%22), reference.getParameterValues(%22param%22));%0A%0A        reference.setParameter(%22param%22, %22value3%22);%0A%0A        assertEquals(Arrays.asList(%22value3%22), reference.getParameterValues(%22param%22));%0A    %7D
 %0A%7D%0A

Add test