Skip to content

Commit

Permalink
re-include class names in reported tests (#126)
Browse files Browse the repository at this point in the history
This amends changes from #87, by removing the redundant ".skip(1)",
and also reverts the changes done to the corresponding unit test.
  • Loading branch information
jodersky authored Nov 27, 2024
1 parent 468d4f3 commit e94d38e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,7 @@ public String format() {
.reduce((first, last) -> last)
.orElse(null);

return path.stream()
.skip(1)
.map(this::toName)
.filter(Objects::nonNull)
.collect(Collectors.joining());
return path.stream().map(this::toName).filter(Objects::nonNull).collect(Collectors.joining());
}

private List<TestIdentifier> getPath(TestPlan testPlan, TestIdentifier identifier) {
Expand Down Expand Up @@ -390,7 +386,7 @@ private String toName(TestIdentifier identifier, Segment segment) {
name = colorTheme.container().format(":" + segment.getValue());
break;
default:
name = segment.getValue();
name = null;
break;
}

Expand Down Expand Up @@ -436,7 +432,7 @@ private String toVintageName(TestIdentifier identifier, Segment lastSegment) {
}
}

return "/" + identifier.getDisplayName();
return null;
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@ public static Object[][] samples() {
// @formatter:off

return new Object[][] {
{"jupiter.samples.NestedTests", "testOfFirstNestedClass", "$First#{1}()"},
{"jupiter.samples.RepeatedTests", "repeatedTest", "#{1}():#1"},
{"jupiter.samples.NestedTests", "testOfFirstNestedClass", "{0}$First#{1}()"},
{"jupiter.samples.RepeatedTests", "repeatedTest", "{0}#{1}():#1"},
{
"jupiter.samples.RepeatedTests",
"repeatedTestWithRepetitionInfo",
"#{1}(org.junit.jupiter.api.RepetitionInfo):#1"
"{0}#{1}(org.junit.jupiter.api.RepetitionInfo):#1"
},
{"jupiter.samples.SimpleTests", "firstTestMethod", "#{1}()"},
{"jupiter.samples.SimpleTests", "testWithParameter", "#{1}(org.junit.jupiter.api.TestInfo)"},
{"jupiter.samples.VintageTests", "vintageTestMethod", "#{1}"},
{"jupiter.samples.VintageEnclosedTests", "testMethod", "$NestedTest#{1}"},
{"jupiter.samples.VintageParameterizedTests", "testParameters", "#{1}[A-65]"},
{"jupiter.samples.SimpleTests", "firstTestMethod", "{0}#{1}()"},
{
"jupiter.samples.SimpleTests",
"testWithParameter",
"{0}#{1}(org.junit.jupiter.api.TestInfo)"
},
{"jupiter.samples.VintageTests", "vintageTestMethod", "{0}#{1}"},
{"jupiter.samples.VintageEnclosedTests", "testMethod", "{0}$NestedTest#{1}"},
{"jupiter.samples.VintageParameterizedTests", "testParameters", "{0}#{1}[A-65]"},
{"jupiter.samples.SuiteTest", "firstTestMethod", "jupiter.samples.SimpleTests#{1}()"},
{"jupiter.samples.SuiteTest", "vintageTestMethod", "jupiter.samples.VintageTests#{1}"}
};
Expand Down

0 comments on commit e94d38e

Please sign in to comment.