Skip to content

Conversation

NikolasFunction
Copy link
Contributor

Added Test for class CodeMetricTrendChart.java
JENKINS-66867

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@codecov
Copy link

codecov bot commented Nov 2, 2021

Codecov Report

Merging #356 (585909a) into master (87dca51) will increase coverage by 2.37%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #356      +/-   ##
============================================
+ Coverage     54.07%   56.45%   +2.37%     
- Complexity      263      273      +10     
============================================
  Files            42       42              
  Lines          1093     1093              
  Branches         92       92              
============================================
+ Hits            591      617      +26     
+ Misses          465      439      -26     
  Partials         37       37              
Impacted Files Coverage Δ
.../plugins/forensics/miner/CodeMetricTrendChart.java 100.00% <0.00%> (+100.00%) ⬆️
...ugins/forensics/miner/CodeMetricSeriesBuilder.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 87dca51...585909a. Read the comment docs.

Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

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

Just some minor coding style issues

import static org.mockito.Mockito.*;

/**
* Tests CodeMetricTrendChart.
Copy link
Member

Choose a reason for hiding this comment

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

Not all IDEs support refactoring in comments:

Suggested change
* Tests CodeMetricTrendChart.
* Tests the class {@link CodeMetricTrendChart}.

* Tests CodeMetricTrendChart.
*
* @author Nikolas Paripovic
*
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 23 to 25

private final CodeMetricTrendChart codeMetricTrendChart = new CodeMetricTrendChart();

Copy link
Member

Choose a reason for hiding this comment

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

See other PR


@Test
void shouldCreate() {
Iterable<BuildResult<ForensicsBuildAction>> buildResults = createBuildResults(false);
Copy link
Member

Choose a reason for hiding this comment

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

Inline empty list


@Test
void shouldCreateWithData() {

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 73 to 74


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

@uhafner uhafner changed the title Added Test for CodeMetricTrendChart Add unit test for CodeMetricTrendChart Nov 2, 2021
@uhafner uhafner added the tests Enhancement of tests label Nov 2, 2021
@uhafner uhafner merged commit 0510b61 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