Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mrginglymus committed Nov 18, 2020
1 parent 5205fee commit d1274bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/hudson/tasks/junit/JUnitResultArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static TestResultSummary parseAndSummarize(@Nonnull JUnitTask task, Pipel
if (!task.isSkipPublishingChecks()) {
// If we haven't been provided with a checks name, and we have pipeline test details, set the checks name
// to be a ' / '-joined string of the enclosing blocks names. If all of that ends up being empty or null,
// set a default of 'Test'
// set a default of 'Tests'
String checksName = task.getChecksName();
if (checksName == null && pipelineTestDetails != null) {
checksName = StringUtils.join(new ReverseListIterator(pipelineTestDetails.getEnclosingBlockNames()), " / ");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.jenkins.plugins.junit.checks;

import hudson.ExtensionList;
import hudson.FilePath;
import hudson.model.Job;
import hudson.model.Result;
Expand Down Expand Up @@ -45,7 +46,7 @@ public void publish(ChecksDetails checksDetails) {
@TestExtension
public static class InterceptingChecksPublisherFactory extends ChecksPublisherFactory {

static InterceptingChecksPublisher publisher = new InterceptingChecksPublisher();
InterceptingChecksPublisher publisher = new InterceptingChecksPublisher();

@Override
protected Optional<ChecksPublisher> createPublisher(Run<?, ?> run, TaskListener listener) {
Expand All @@ -58,13 +59,8 @@ protected Optional<ChecksPublisher> createPublisher(Job<?, ?> job, TaskListener
}
}

@After
public void clearDetails() {
InterceptingChecksPublisherFactory.publisher.details.clear();
}

private ChecksDetails getDetail() {
List<ChecksDetails> details = InterceptingChecksPublisherFactory.publisher.details;
List<ChecksDetails> details = ExtensionList.lookupSingleton(InterceptingChecksPublisherFactory.class).publisher.details;
assertThat(details.size(), is(1));
return details.get(0);
}
Expand Down

0 comments on commit d1274bc

Please sign in to comment.