@Test(groups = "TestUrlBuilder") public void appendQueryString() { String cb = "cb=1111"; Configuration.setTestValue("qs", cb); Assertion.assertEquals( new UrlBuilder("prod").getUrlForPath("wowwiki", "Portal:Main"), "http://wowwiki.wikia.com/Portal:Main?" + cb); }
@Test(groups = "TestUrlBuilder") public void urlBuilder() { Configuration.setTestValue("qs", ""); for (Object[] data : TEST_DATA) { Assertion.assertEquals( new UrlBuilder("prod").getUrlForPath((String) data[0], (String) data[1]), (String) data[2]); Assertion.assertEquals( new UrlBuilder("preview").getUrlForPath((String) data[0], (String) data[1]), (String) data[3]); Assertion.assertEquals( new UrlBuilder("sandbox").getUrlForPath((String) data[0], (String) data[1]), (String) data[4]); Assertion.assertEquals( new UrlBuilder("sandbox-mercurydev").getUrlForPath((String) data[0], (String) data[1]), (String) data[5]); Assertion.assertEquals( new UrlBuilder("dev-dmytror").getUrlForPath((String) data[0], (String) data[1]), (String) data[6]); } }