package jetbrains.buildServer.core.runtime;

import java.net.URL;

import jetbrains.buildServer.tools.AbstractToolingTestCase;
import jetbrains.buildServer.tools.JDKTools;
import junit.framework.Assert;

import org.junit.Test;

public class URIDownloaderTest extends AbstractToolingTestCase {

  @Test
  public void url_interception_test() throws Exception {
    final URL testingURL = new URL("https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u23-oth-JPR@CDS-CDS_Developer");
    final URL expectedURL = RuntimeUtil.URIDownloader.intercept(testingURL, RuntimeUtil.CONSOLE_MONITOR, JDKTools.JDKUrlInterceptor.class);
    Assert.assertNotNull(expectedURL);
    Assert.assertTrue(!expectedURL.equals(testingURL));
  }

}
