Push method code coverage bar to 50 percent

This change adds or update a swath of tests to push method code coverage numbers up.
Yes, method coverage is not super meaningful, but it is one metric that we can use to
ensure at least minimal coverage of this library.

Almost no product changes in here.
This commit is contained in:
Liam Newman
2021-01-25 11:58:01 -08:00
parent 8e6dbf3772
commit 35c8cfa01d
258 changed files with 49289 additions and 2257 deletions

View File

@@ -34,6 +34,7 @@ public class GHRepositoryStatisticsTest extends AbstractGitHubWireMockTest {
for (GHRepositoryStatistics.ContributorStats statsForAuthor : list) {
if (authorLogin.equals(statsForAuthor.getAuthor().getLogin())) {
assertEquals(715, statsForAuthor.getTotal());
assertEquals("kohsuke made 715 contributions over 494 weeks", statsForAuthor.toString());
List<GHRepositoryStatistics.ContributorStats.Week> weeks = statsForAuthor.getWeeks();
assertEquals(494, weeks.size());
@@ -46,6 +47,8 @@ public class GHRepositoryStatisticsTest extends AbstractGitHubWireMockTest {
assertEquals(63, week.getNumberOfAdditions());
assertEquals(56, week.getNumberOfDeletions());
assertEquals(5, week.getNumberOfCommits());
assertEquals("Week starting 1541289600 - Additions: 63, Deletions: 56, Commits: 5",
week.toString());
} catch (NoSuchElementException e) {
fail("Did not find week 1546128000");
}
@@ -131,6 +134,7 @@ public class GHRepositoryStatisticsTest extends AbstractGitHubWireMockTest {
if (item.getWeekTimestamp() == 1535241600) {
assertEquals(185, item.getAdditions());
assertEquals(-243, item.getDeletions());
assertEquals("Week starting 1535241600 has 185 additions and 243 deletions", item.toString());
foundWeek = true;
break;
}
@@ -196,6 +200,7 @@ public class GHRepositoryStatisticsTest extends AbstractGitHubWireMockTest {
// TODO: Make an easier access method. Perhaps wrap in an
// object and have a method such as GetCommits(1, 16).
assertEquals(16, item.getNumberOfCommits());
assertEquals("Day 2 Hour 10: 16 commits", item.toString());
hourFound = true;
break;
}