package be.iminds.ilabt.jfed.experimenter_gui.util;

import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.Map;

/**
 * User: twalcari
 * Date: 6/25/2015
 * Time: 17:15
 */
public class URIUtilsTest {

    @Test
    public void testProcessJFedUri1() throws Exception {
        Map<String, String> test1 = URIUtils.processJFedUri("jfed://key1=val1&key2=val2");

        Assert.assertNotNull(test1);
        Assert.assertEquals(test1.size(), 2);
        Assert.assertEquals(test1.get("key1"), "val1");
        Assert.assertEquals(test1.get("key2"), "val2");
    }

    @Test
    public void testProcessJFedUri2() throws Exception {
        Map<String, String> test1 = URIUtils.processJFedUri("jfed:key1=val1&key2=val2");

        Assert.assertNotNull(test1);
        Assert.assertEquals(test1.size(), 2);
        Assert.assertEquals(test1.get("key1"), "val1");
        Assert.assertEquals(test1.get("key2"), "val2");
    }
}