/*
 * Axelor Business Solutions
 *
 * Copyright (C) 2019 Axelor (<http://axelor.com>).
 *
 * This program is free software: you can redistribute it and/or  modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.axelor.apps.tool.net;

import com.axelor.apps.tool.exception.IExceptionMessage;
import com.axelor.i18n.I18n;
import org.junit.Assert;
import org.junit.Test;

public class TestURLService {

  @Test
  public void testNotExist() {

    Assert.assertNull(URLService.notExist("http://www.google.com"));

    String url = "www.google.com";
    Assert.assertEquals(
        String.format(I18n.get(IExceptionMessage.URL_SERVICE_2), url), URLService.notExist(url));

    url = "http://www.testtrgfgfdg.com/";
    Assert.assertEquals(
        String.format(I18n.get(IExceptionMessage.URL_SERVICE_3), url), URLService.notExist(url));
  }
}

@@ -933,16 +933,58 @@
 st() %7B%0A%0A
+    String url = %22http://www.google.com%22;%0A
     Asse
@@ -1017,39 +1017,19 @@
 otExist(
-%22http://www.google.com%22
+url
 ));%0A%0A   
@@ -1025,31 +1025,24 @@
 url));%0A%0A    
-String 
 url = %22www.g
@@ -1199,24 +1199,27 @@
 p://
-www.testtrgfgfdg
+testnotfound.axelor
 .com

Improve TestUrlService with better urls