Skip to content

Commit

Permalink
Add default variable name for ReleaseNotes generation.
Browse files Browse the repository at this point in the history
JENKINS-30829
  • Loading branch information
Radosław Antoniuk committed Oct 26, 2015
1 parent 23ee171 commit dc14647
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Expand Up @@ -32,9 +32,12 @@ public String getDisplayName() {
public boolean isApplicable(final AbstractProject<?, ?> item) {
return true;
}

}

public static final String DEFAULT_FILTER = "status in (Resolved, Closed)";
public static final String DEFAULT_ENVVAR_NAME = "RELEASE_NOTES";

private String jiraEnvironmentVariable;
private String jiraProjectKey;
private String jiraRelease;
Expand All @@ -54,7 +57,7 @@ public JiraCreateReleaseNotes(final String jiraProjectKey,
final String jiraFilter) {
this.jiraRelease = jiraRelease;
this.jiraProjectKey = jiraProjectKey;
this.jiraEnvironmentVariable = jiraEnvironmentVariable;
this.jiraEnvironmentVariable = defaultIfEmpty(jiraEnvironmentVariable, DEFAULT_ENVVAR_NAME);
this.jiraFilter = defaultIfEmpty(jiraFilter, DEFAULT_FILTER);
}

Expand Down
@@ -1,4 +1,4 @@
<div>
<p>Specify the environment variable to which the release notes will be stored.</p>
<p>Specify the environment variable to which the release notes will be stored, defaults to RELEASE_NOTES.</p>
<p>This can be used in another build step which supports environments. </p>
</div>
Expand Up @@ -22,7 +22,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

;
import static org.junit.Assert.assertEquals;

@RunWith(MockitoJUnitRunner.class)
public class JiraCreateReleaseNotesTest {
Expand Down Expand Up @@ -72,6 +72,12 @@ else if (expanded.equals(JIRA_RELEASE_PARAM))

}

@Test
public void testDefaults(){
JiraCreateReleaseNotes jcrn = new JiraCreateReleaseNotes(JIRA_PRJ,JIRA_RELEASE,"");
assertEquals(JiraCreateReleaseNotes.DEFAULT_ENVVAR_NAME, jcrn.getJiraEnvironmentVariable());
assertEquals(JiraCreateReleaseNotes.DEFAULT_FILTER, jcrn.getJiraFilter());
}

@Test
public void jiraApiCallDefaultFilter() throws InterruptedException, IOException {
Expand Down

0 comments on commit dc14647

Please sign in to comment.