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

import java.util.Locale;

import org.junit.Assert;
import org.junit.Test;

/**
 * Validate {@link LocaleUtils}.
 * 
 * @version $Id$
 */
public class LocaleUtilsTest
{
    @Test
    public void getParentLocale()
    {
        Assert.assertEquals(Locale.ENGLISH, LocaleUtils.getParentLocale(Locale.US));
        Assert.assertEquals(Locale.ROOT, LocaleUtils.getParentLocale(Locale.ENGLISH));
        Assert.assertEquals(null, LocaleUtils.getParentLocale(Locale.ROOT));
    }

    @Test
    public void toLocale()
    {
        Assert.assertEquals(null, LocaleUtils.toLocale((String) null));
        Assert.assertEquals(Locale.ROOT, LocaleUtils.toLocale(""));
        Assert.assertEquals(Locale.ENGLISH, LocaleUtils.toLocale("en"));
        Assert.assertEquals(Locale.US, LocaleUtils.toLocale("en_US"));

        Assert.assertEquals(Locale.FRENCH, LocaleUtils.toLocale("badLocale", Locale.FRENCH));
    }
}

@@ -967,23 +967,41 @@
 nit.
-Asser
+jupiter.api.Tes
 t;%0A
+%0A
 import 
+static 
 org.
@@ -1006,20 +1006,51 @@
 g.junit.
-Test
+jupiter.api.Assertions.assertEquals
 ;%0A%0A/**%0A 
@@ -1106,23 +1106,16 @@
 Id$%0A */%0A
-public 
 class Lo
@@ -1140,31 +1140,24 @@
   @Test%0A    
-public 
 void getPare
@@ -1173,39 +1173,32 @@
 )%0A    %7B%0A        
-Assert.
 assertEquals(Loc
@@ -1251,39 +1251,32 @@
 e.US));%0A        
-Assert.
 assertEquals(Loc
@@ -1331,39 +1331,32 @@
 LISH));%0A        
-Assert.
 assertEquals(nul
@@ -1426,15 +1426,8 @@
     
-public 
 void
@@ -1444,39 +1444,32 @@
 )%0A    %7B%0A        
-Assert.
 assertEquals(nul
@@ -1509,39 +1509,32 @@
 null));%0A        
-Assert.
 assertEquals(Loc
@@ -1570,39 +1570,32 @@
 e(%22%22));%0A        
-Assert.
 assertEquals(Loc
@@ -1636,39 +1636,32 @@
 %22en%22));%0A        
-Assert.
 assertEquals(Loc
@@ -1713,15 +1713,8 @@
     
-Assert.
 asse

Convert to JUnit5