@Test public void shouldNotRemoveServicesFromTheHostOfTheUrlFromTheLegacyCrowdPropertiesFile() { final String expectedServiceUrl = "http://services-crowd.atlassian.com"; UpgradeTask_Build601.CrowdServiceUrlBuilder serviceUrlBuilder = new UpgradeTask_Build601.CrowdServiceUrlBuilder(); final String serviceUrl = serviceUrlBuilder.setPropertiesUrlTo("http://services-crowd.atlassian.com").build(); assertEquals( "If 'services' is part of the url it should be preserved unless it's at the end of the url path.", expectedServiceUrl, serviceUrl); }
@Test public void shouldRemoveSoapPathEndingWithASlashFromTheLegacyCrowdPropertiesFile() { final String expectedServiceUrl = "http://test-crowd.atlassian.com"; UpgradeTask_Build601.CrowdServiceUrlBuilder serviceUrlBuilder = new UpgradeTask_Build601.CrowdServiceUrlBuilder(); final String serviceUrl = serviceUrlBuilder.setPropertiesUrlTo("http://test-crowd.atlassian.com/services/").build(); assertEquals( "The service url should be built without '/services/' at the end of the url path.", expectedServiceUrl, serviceUrl); }
@Test public void shouldOnlyRemoveServicesFromTheEndOfTheUrlInTheLegacyCrowdPropertiesFile() { final String expectedServiceUrl = "http://services-crowd.atlassian.com"; UpgradeTask_Build601.CrowdServiceUrlBuilder serviceUrlBuilder = new UpgradeTask_Build601.CrowdServiceUrlBuilder(); final String serviceUrl = serviceUrlBuilder .setPropertiesUrlTo("http://services-crowd.atlassian.com/services") .build(); assertEquals( "The service url should be built without '/services' at the end of the url path and no other" + " instances of the word 'services' should be removed from the original url.", expectedServiceUrl, serviceUrl); }