Skip to content

Commit

Permalink
Testing trailing slash in Jira
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Apr 28, 2016
1 parent f0323ef commit 0c85c42
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package se.bjurr.gitchangelog.internal.integrations.jira;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;

import se.bjurr.gitchangelog.api.exceptions.GitChangelogIntegrationException;

import com.google.common.base.Optional;

public class JiraClientTest {

@Test
public void testThatTrailingSlashIsRemoved() {
JiraClient client = createClient("https://server.com/jira/");
assertThat(client.getApi())//
.isEqualTo("https://server.com/jira");
}

@Test
public void testThatNoTrailingSlashUrlIsUntouched() {
JiraClient client = createClient("https://server.com/jira");
assertThat(client.getApi())//
.isEqualTo("https://server.com/jira");
}

private JiraClient createClient(String api) {
return new JiraClient(api) {

@Override
public JiraClient withBasicCredentials(String username, String password) {
return null;
}

@Override
public Optional<JiraIssue> getIssue(String matched) throws GitChangelogIntegrationException {
return null;
}
};
}
}

0 comments on commit 0c85c42

Please # to comment.