Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix crash at milestone.dueOn #119

Merged
merged 5 commits into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
-->
## Master
- Update Kotlin to 1.4.0 [@uzzu][] - [#116](https://github.com/danger/kotlin/pull/116)
- Fix crash at milestone.dueOn [@anton46][] - [#108](https://github.com/danger/kotlin/pull/119)

# 0.6.1

Original file line number Diff line number Diff line change
@@ -471,5 +471,5 @@ data class GitHubMilestone(
@Json(name = "created_at") val createdAt: Date,
@Json(name = "updated_at") val updatedAt: Date,
@Json(name = "closed_at") val closedAt: Date?,
@Json(name = "due_on") val dueOn: Date
@Json(name = "due_on") val dueOn: Date?
)
Original file line number Diff line number Diff line change
@@ -196,12 +196,23 @@ class GitHubParsingTests {
}

@Test
fun testOnGitHubIsTrue(){
fun testItParsesTheMilestonesWithSomeNullAttributes() {
val dsl = moshi.fromJson(jsonFiles.githubWithSomeNullsAttributeDangerJSON)!!
val github = dsl.danger.github

with(github.issue.milestone!!) {
assertNull(dueOn)
assertNull(closedAt)
}
}

@Test
fun testOnGitHubIsTrue() {
assertEquals(true, dsl.danger.onGitHub)
}

@Test
fun testOnBitBucketIsFalse(){
fun testOnBitBucketIsFalse() {
assertEquals(false, dsl.danger.onBitBucketServer)
}

Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ package systems.danger.kotlin
class JSONFiles {
val githubDangerJSON
get() = loadJSON("githubDangerJSON.json")
val githubWithSomeNullsAttributeDangerJSON
get() = loadJSON("githubWithSomeNullsAttributeDangerJSON.json")
val dangerBitBucketServerJSON
get() = loadJSON("bitbucketServerDangerJSON.json")
val gitlabJSON
Loading