Skip to content
Permalink
Browse files

[JENKINS-41881] Do not store test project unnecessarily.

  • Loading branch information
Evaristo Gutiérrez
Evaristo Gutiérrez committed Feb 10, 2017
1 parent 11b6c3a commit 90afad3c59e6d640186bafbdcb84bf7aa400779b
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/test/java/hudson/tasks/MailerTest.java
@@ -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 {
@@ -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);
}
@@ -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));
}

0 comments on commit 90afad3

Please sign in to comment.
You can’t perform that action at this time.