Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-include class names in reported tests #126

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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