/*
 * This file is part of dependency-check-core.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Copyright (c) 2017 Jeremy Long. All Rights Reserved.
 */
package org.owasp.dependencycheck.utils;

import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author jeremy long
 */
public class UrlStringUtilsTest {

    /**
     * Test of containsUrl method, of class UrlStringUtils.
     */
    @Test
    public void testContainsUrl() {
        String text = "Test of https://github.com";
        assertTrue(UrlStringUtils.containsUrl(text));
        text = "Test of github.com";
        assertFalse(UrlStringUtils.containsUrl(text));
    }

    /**
     * Test of isUrl method, of class UrlStringUtils.
     */
    @Test
    public void testIsUrl() {
        String text = "https://github.com";
        assertTrue(UrlStringUtils.isUrl(text));
        text = "simple text";
        assertFalse(UrlStringUtils.isUrl(text));
    }

    /**
     * Test of extractImportantUrlData method, of class UrlStringUtils.
     */
    @Test
    public void testExtractImportantUrlData() throws Exception {
        String text = "http://github.com/jeremylong/DependencyCheck/index.html";
        List<String> expResult = Arrays.asList("github", "jeremylong", "DependencyCheck", "index");
        List<String> result = UrlStringUtils.extractImportantUrlData(text);
        assertEquals(expResult, result);
        
        text = "http://github.com/jeremylong/DependencyCheck/.gitignore";
        expResult = Arrays.asList("github", "jeremylong", "DependencyCheck", "gitignore");
        result = UrlStringUtils.extractImportantUrlData(text);
        assertEquals(expResult, result);
        
        text = "http://github.com/jeremylong/DependencyCheck/something";
        expResult = Arrays.asList("github", "jeremylong", "DependencyCheck", "something");
        result = UrlStringUtils.extractImportantUrlData(text);
        assertEquals(expResult, result);
    }

}

@@ -1731,18 +1731,18 @@
 eck/
-index.html
+.gitignore
 %22;%0A 
@@ -1783,34 +1783,24 @@
 rays.asList(
-%22github%22, 
 %22jeremylong%22
@@ -1825,13 +1825,17 @@
 %22, %22
-index
+gitignore
 %22);%0A
@@ -1979,35 +1979,24 @@
 t = %22http://
-github.com/
 jeremylong/D
@@ -1985,32 +1985,42 @@
 ttp://jeremylong
+.github.io
 /DependencyCheck
@@ -2016,34 +2016,34 @@
 ndencyCheck/
-.gitignore
+index.html
 %22;%0A        e
@@ -2063,34 +2063,24 @@
 rays.asList(
-%22github%22, 
 %22jeremylong%22
@@ -2097,33 +2097,29 @@
 ncyCheck%22, %22
-gitignore
+index
 %22);%0A        
@@ -2238,38 +2238,39 @@
  text = %22http://
-github
+example
 .com/jeremylong/
@@ -2332,22 +2332,23 @@
 asList(%22
-github
+example
 %22, %22jere

fix test case