File tree Expand file tree Collapse file tree 5 files changed +512
-3
lines changed
main/kotlin/dev/hossain/githubstats
kotlin/dev/hossain/githubstats Expand file tree Collapse file tree 5 files changed +512
-3
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class PullStats(private val githubService: GithubService) {
4343
4444 println (" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" )
4545
46+ println (" PR: ${pullRequest.title} (${pullRequest.html_url} )" )
4647 println (" PR Available: ${dateFormatter.format(prAvailableForReview.toJavaInstant())} " )
4748 println (" Review Time: $reviewCompletionInfo " )
4849 println (
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ data class PullRequest(
88 val state : String ,
99 val title : String ,
1010 val url : String ,
11+ val html_url : String ,
1112 val created_at : String ,
1213 val updated_at : String? ,
1314 val closed_at : String? ,
Original file line number Diff line number Diff line change @@ -47,9 +47,9 @@ internal class PullStatsTest {
4747
4848 @Test
4949 fun `calculateStats - given merged with no reviewer - provides no related metrics` () = runTest {
50- // Uses data from https://github.com/square/retrofit /pull/3114
51- mockWebServer.enqueue(MockResponse ().setBody(respond(" pulls-retrofit-3114 .json" )))
52- mockWebServer.enqueue(MockResponse ().setBody(respond(" timeline-retrofit-3114 .json" )))
50+ // Uses data from https://github.com/hossain-khan/github-stats /pull/27
51+ mockWebServer.enqueue(MockResponse ().setBody(respond(" pulls-githubstats-27 .json" )))
52+ mockWebServer.enqueue(MockResponse ().setBody(respond(" timeline-githubstats-27 .json" )))
5353
5454 val calculateStats = pullStats.calculateStats(123 )
5555
@@ -63,6 +63,14 @@ internal class PullStatsTest {
6363
6464 @Test
6565 fun `calculateStats - given no assigned reviewer added - provides metrics based on approval event` () = runTest {
66+ // Uses data from https://github.com/square/retrofit/pull/3114
67+ mockWebServer.enqueue(MockResponse ().setBody(respond(" pulls-retrofit-3114.json" )))
68+ mockWebServer.enqueue(MockResponse ().setBody(respond(" timeline-retrofit-3114.json" )))
69+
70+ val calculateStats = pullStats.calculateStats(123 )
71+
72+ // TODO Test requires update based on return data
73+ assertThat(calculateStats).isInstanceOf(PullStats .StatsResult .Failure ::class .java)
6674 }
6775
6876 // region: Test Utility Functions
You can’t perform that action at this time.
0 commit comments