Skip to content

Commit

Permalink
Add @issue annotations to CredentialsTest
Browse files Browse the repository at this point in the history
Reduce CredentialsTest differences between stable-2.7 and master
branch
  • Loading branch information
MarkEWaite committed Aug 1, 2018
1 parent 58a254d commit f062e58
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.json.simple.JSONObject;
import org.json.simple.JSONArray;
Expand Down Expand Up @@ -353,6 +354,7 @@ private boolean testPeriodNotExpired() {
}

@Test
@Issue("JENKINS_50573")
public void testFetchWithCredentials() throws URISyntaxException, GitException, InterruptedException, MalformedURLException, IOException {
assumeTrue(testPeriodNotExpired());
File clonedFile = new File(repo, fileToCheck);
Expand Down Expand Up @@ -402,27 +404,11 @@ public void testRemoteReferencesWithCredentials() throws Exception {
assertThat(remoteReferences.keySet(), hasItems("refs/heads/master"));
}

private String show(String name, String value) {
if (value != null && !value.isEmpty()) {
return " " + name + ": '" + value + "'";
}
return "";
}

private String show(String name, File file) {
if (file != null) {
String homePath = HOME_DIR.getAbsolutePath();
String filePath = file.getAbsolutePath();
if (filePath.startsWith(homePath)) {
filePath = filePath.replace(homePath, "~");
}
return " " + name + ": '" + filePath + "'";
}
return "";
}

private String show(String name, char value) {
return " " + name + ": '" + value + "'";
@Test
@Issue("JENKINS_50573")
public void isURIishRemote() throws Exception {
URIish uri = new URIish(gitRepoURL);
assertTrue("Should be remote but isn't: " + uri, uri.isRemote());
}

private boolean isWindows() {
Expand Down

0 comments on commit f062e58

Please sign in to comment.