PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/maven-amps-plugin/src/test/java/com/atlassian/maven/plugins/amps/product/CrowdProductHandlerTest.java

https://bitbucket.org/mmeinhold/amps
Java | 24 lines | 19 code | 5 blank | 0 comment | 0 complexity | 81c2f6733d593d9c6aef08417b3e5219 MD5 | raw file
 1package com.atlassian.maven.plugins.amps.product;
 2
 3import java.net.URISyntaxException;
 4
 5import org.junit.Test;
 6
 7import static org.junit.Assert.assertEquals;
 8
 9public class CrowdProductHandlerTest
10{
11    @Test
12    public void crowdServerUriConvertedToUseLocalhost() throws URISyntaxException
13    {
14        String uri = "http://example.test:8080/prefix/crowd?query#fragment";
15        assertEquals("http://localhost:8080/prefix/crowd?query#fragment", CrowdProductHandler.withLocalhostAsHostname(uri));
16    }
17
18    @Test
19    public void crowdServerUriConvertedToUseLocalhostWithHttps() throws URISyntaxException
20    {
21        String uri = "https://example.test:8080/prefix/crowd?query#fragment";
22        assertEquals("https://localhost:8080/prefix/crowd?query#fragment", CrowdProductHandler.withLocalhostAsHostname(uri));
23    }
24}