/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

  1. package com.atlassian.maven.plugins.amps.product;
  2. import java.net.URISyntaxException;
  3. import org.junit.Test;
  4. import static org.junit.Assert.assertEquals;
  5. public class CrowdProductHandlerTest
  6. {
  7. @Test
  8. public void crowdServerUriConvertedToUseLocalhost() throws URISyntaxException
  9. {
  10. String uri = "http://example.test:8080/prefix/crowd?query#fragment";
  11. assertEquals("http://localhost:8080/prefix/crowd?query#fragment", CrowdProductHandler.withLocalhostAsHostname(uri));
  12. }
  13. @Test
  14. public void crowdServerUriConvertedToUseLocalhostWithHttps() throws URISyntaxException
  15. {
  16. String uri = "https://example.test:8080/prefix/crowd?query#fragment";
  17. assertEquals("https://localhost:8080/prefix/crowd?query#fragment", CrowdProductHandler.withLocalhostAsHostname(uri));
  18. }
  19. }