package app.intra.net.socks;

import static org.junit.Assert.*;

import app.intra.net.socks.TLSProbe.Result;
import org.junit.Test;

public class TLSProbeTest {

  @Test
  public void success() {
    assertEquals(Result.SUCCESS,
        TLSProbe.run(null, TLSProbe.DEFAULT_URL));
  }

  @Test
  public void tlsFailed() {
    assertEquals(Result.TLS_FAILED,
        TLSProbe.run(null, "https://untrusted-root.badssl.com/"));
    assertEquals(Result.TLS_FAILED,
        TLSProbe.run(null, "https://self-signed.badssl.com/"));
  }

  @Test
  public void otherFailedDNS() {
    assertEquals(Result.OTHER_FAILED,
        TLSProbe.run(null, "https://bad-domain.bad-tld/"));
  }

  @Test
  public void otherFailedEmpty() {
    assertEquals(Result.OTHER_FAILED,
        TLSProbe.run(null, "https://dns.google:53/"));
  }
}

@@ -1,8 +1,573 @@
+/*%0ACopyright 2019 Jigsaw Operations LLC%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0Ahttps://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A*/%0A
 package 

Add copyright notice