Skip to content

Commit

Permalink
[JENKINS-41881] Do not store test project unnecessarily.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evaristo Gutiérrez committed Feb 10, 2017
1 parent 11b6c3a commit 90afad3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/test/java/hudson/tasks/MailerTest.java
Expand Up @@ -283,7 +283,7 @@ TestBuild build(String... mailboxesToClear) throws Exception {
for (String recipient : mailboxesToClear) {
getEmptyMailbox(recipient);
}
return new TestBuild(project, project.scheduleBuild2(0).get());
return new TestBuild(project.scheduleBuild2(0).get());
}

TestBuild clearBuild() throws Exception {
Expand All @@ -307,12 +307,10 @@ TestProject buildAndCheckContent() throws Exception {
}

private final class TestBuild {
private final FreeStyleProject project;
private final FreeStyleBuild build;
private final String log;

TestBuild(FreeStyleProject project, FreeStyleBuild build) throws Exception {
this.project = project;
TestBuild(FreeStyleBuild build) throws Exception {
this.build = build;
this.log = rule.getLog(build);
}
Expand All @@ -328,7 +326,7 @@ TestBuild check(int expectedRecipient, int expectedAuthor1, int expectedAuthor2)
}

void checkContent() throws Exception {
String expectedInMessage = String.format("<%sjob/%s/%d/display/redirect>\n\n", rule.getURL(), this.project.getName(), this.build.getNumber());
String expectedInMessage = String.format("<%sjob/%s/%d/display/redirect>\n\n", rule.getURL(), this.build.getProject().getName(), this.build.getNumber());
String emailContent = getMailbox(RECIPIENT).get(0).getContent().toString();
assertThat(emailContent, containsString(expectedInMessage));
}
Expand Down

0 comments on commit 90afad3

Please sign in to comment.