-
Notifications
You must be signed in to change notification settings - Fork 31
Add test for RelativeCountTrendChartTest
#355
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
Add test for RelativeCountTrendChartTest
#355
Conversation
RelativeCountTrendChartTest
Codecov Report
@@ Coverage Diff @@
## master #355 +/- ##
============================================
+ Coverage 54.07% 58.18% +4.11%
- Complexity 263 280 +17
============================================
Files 42 42
Lines 1093 1093
Branches 92 92
============================================
+ Hits 591 636 +45
+ Misses 465 420 -45
Partials 37 37
Continue to review full report at Codecov.
|
* Tests RelativeCountTrendChart. | ||
* | ||
* @author Nikolas Paripovic | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* |
* | ||
*/ | ||
class RelativeCountTrendChartTest { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use new lines only to structure code
|
||
@Test | ||
void shouldCreate() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*/ | ||
class RelativeCountTrendChartTest { | ||
|
||
private final RelativeCountTrendChart relativeCountTrendChart = new RelativeCountTrendChart(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No fields in unit tests, inline that into the method
@Test | ||
void shouldCreate() { | ||
|
||
Iterable<BuildResult<CommitStatisticsBuildAction>> buildResult = createBuildResults(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline that call to make it readable:
Iterable<BuildResult<CommitStatisticsBuildAction>> buildResult = createBuildResults(false); | |
Iterable<BuildResult<CommitStatisticsBuildAction>> buildResult = new ArrayList<>(); |
|
||
LinesChartModel linesChartModel = relativeCountTrendChart.create(buildResult, chartModelConfiguration, seriesBuilder); | ||
assertThat(linesChartModel.getSeries()).hasSize(3); | ||
assertThat(linesChartModel.getSeries()).allSatisfy(series -> assertThat(series.getData()).hasSize(4)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: if you want to make sure that the chart actually is correct, you can use JSON assertions, see review in #351
Seems to be a bug that commit/build #73bcd5d failed. |
I think the download of an artifact from the maven repository was broken but that should be fixed now. |
Added Test for class RelativeCountTrendChart.java
JENKINS-66866