package fabricator.j.tests;

import org.testng.annotations.Test;

import java.util.HashMap;

import static org.testng.Assert.assertEquals;

public class JavaInternetTestSuite extends JavaBaseTest {

    @Test
    public void testUrl() {
        final HashMap<String, Object> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("hello", "test");
        stringStringHashMap.put("hello2", "test2");
        stringStringHashMap.put("hello3", "test 3");
        final String url = internet.urlBuilder().host("test.ru").paramsinJava(stringStringHashMap).toString();
        assertEquals("http://test.ru/getEntity?hello=test&hello2=test2&hello3=test+3", url);
    }
}

@@ -76,23 +76,71 @@
 va.util.
-HashMap
+Arrays;%0Aimport java.util.HashMap;%0Aimport java.util.List
 ;%0A%0Aimpor
@@ -179,16 +179,60 @@
 tEquals;
+%0Aimport static org.testng.Assert.assertTrue;
 %0A%0Apublic
@@ -683,65 +683,347 @@
 sert
-Equals(%22http://test.ru/getEntity?hello=test&hello2=test2&
+True(url.matches(%22%5E(.*:)//(%5BA-Za-z0-9%5C%5C-%5C%5C.%5D+)(:%5B0-9%5D+)?(.*)$%22));%0A        String params = url.split(%22/%22)%5B3%5D;%0A        List%3CString%3E stringList = Arrays.asList(params.split(%22&%22));%0A        assertTrue(stringList.contains(%22getEntity?hello=test%22));%0A        assertTrue(stringList.contains(%22hello2=test2%22));%0A        assertTrue(stringList.contains(%22
 hell
@@ -1036,13 +1036,9 @@
 t+3%22
-, url
+)
 );%0A 

add fix for failing JavaInternetTestSuite