Skip to content

Commit

Permalink
JENKINS-42090
Browse files Browse the repository at this point in the history
JENKINS-42090

include link to claimed test case in claim mail
  • Loading branch information
fl0l-gouze committed Apr 9, 2018
1 parent 4e889c3 commit 98e7453
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/claim/ClaimTestAction.java
Expand Up @@ -52,7 +52,7 @@ public String getNoun() {

@Override
String getUrl() {
return data.getUrl();
return data.getUrl() + "testReport/" + this.testObjectId;
}

@Override
Expand Down
17 changes: 14 additions & 3 deletions src/test/java/hudson/plugins/claim/ClaimTest.java
Expand Up @@ -27,12 +27,11 @@
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertEquals;

import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput;
import com.gargoylesoftware.htmlunit.html.HtmlFormUtil;
import hudson.model.Build;
import hudson.model.Project;
import hudson.model.Result;
import hudson.model.*;
import hudson.plugins.claim.utils.TestBuilder;
import hudson.security.FullControlOnceLoggedInAuthorizationStrategy;

Expand Down Expand Up @@ -233,6 +232,18 @@ public void stickyClaimOnPreviousBuildPropagatesToFollowingFailedBuildsUntilBuil
assertThat(action3.getReason(), is(claimText));
assertThat(action3.isSticky(), is(true));
assertThat(action3.getAssignedBy(), is("user1"));
}


@Test
public void ClaimTestShouldGiveProperURL() {

ClaimTestDataPublisher.Data data = new ClaimTestDataPublisher.Data(firstBuild);
//testObjectId now contains junit/ since hudson 1.347
ClaimTestAction acti = new ClaimTestAction(data, "junit/assembly/classTest/unitTest");
assertEquals("wrong url who would not link to test","job/x/1/testReport/junit/assembly/classTest/unitTest", acti.getUrl());


}

private void givenProjectIsSucceeding() {
Expand Down

0 comments on commit 98e7453

Please sign in to comment.