Skip to content

Conversation

bleibdirtroy
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Oct 27, 2021

Codecov Report

Merging #352 (64be625) into master (778209f) will increase coverage by 5.39%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #352      +/-   ##
============================================
+ Coverage     50.04%   55.44%   +5.39%     
- Complexity      253      271      +18     
============================================
  Files            42       42              
  Lines          1093     1093              
  Branches         92       92              
============================================
+ Hits            547      606      +59     
+ Misses          510      450      -60     
- Partials         36       37       +1     
Impacted Files Coverage Δ
...ics/miner/RelativeCountForensicsSeriesBuilder.java 50.00% <0.00%> (+50.00%) ⬆️
.../jenkins/plugins/forensics/miner/SizePieChart.java 86.66% <0.00%> (+86.66%) ⬆️
...s/plugins/forensics/miner/ForensicsTableModel.java 100.00% <0.00%> (+100.00%) ⬆️
...er/RelativeCountCommitStatisticsSeriesBuilder.java 100.00% <0.00%> (+100.00%) ⬆️
...AddedVersusDeletedLinesForensicsSeriesBuilder.java 100.00% <0.00%> (+100.00%) ⬆️
...rsusDeletedLinesCommitStatisticsSeriesBuilder.java 100.00% <0.00%> (+100.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 778209f...64be625. Read the comment docs.

import static org.mockito.Mockito.*;

class RelativeCountCommitStatisticsSeriesBuilderTest {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines 25 to 27
assertThat(result.get("commits")).isEqualTo(7);
assertThat(result.get("authors")).isEqualTo(11);
assertThat(result.get("files")).isEqualTo(17);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the constants of the builder

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A simpler way would be:

assertThat(result)
                 .containsEntry(COMMITS, 7)
                 .containsEntry(AUTHORS, 11);

@uhafner uhafner changed the title First test for RelativeCountCommitStatisticsSeriesBuilder Add a unit test for RelativeCountCommitStatisticsSeriesBuilder Nov 2, 2021
@uhafner uhafner added the tests Enhancement of tests label Nov 2, 2021
Comment on lines 11 to 13
static final String COMMITS = "commits";
static final String AUTHORS = "authors";
static final String FILES = "files";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uhafner uhafner merged commit ee2a15c into jenkinsci:master Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Enhancement of tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants