}
public String url() {
- return configuration.get(GITLAB_AUTH_URL).orElse(null);
+ String url = configuration.get(GITLAB_AUTH_URL).orElse(null);
+ if (url != null && url.endsWith("/")) {
+ return url.substring(0, url.length() - 1);
+ }
+ return url;
}
public String applicationId() {
@Test
public void test_settings() {
assertThat(config.url()).isEqualTo("https://gitlab.com");
+
+ settings.setProperty(GITLAB_AUTH_URL, "https://gitlab.com/api/");
+ assertThat(config.url()).isEqualTo("https://gitlab.com/api");
+
+
settings.setProperty(GITLAB_AUTH_URL, "https://gitlab.com/api");
assertThat(config.url()).isEqualTo("https://gitlab.com/api");