diff --git a/CHANGELOG.md b/CHANGELOG.md index 46f63ec..46cace9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +0.2.2 / 2017-03-22 +================== + +* Restore signature of `addPluginMessage` + 0.2.1 / 2017-03-22 ================== diff --git a/src/main/kotlin/com/netflix/nebula/dependencybase/DependencyManagement.kt b/src/main/kotlin/com/netflix/nebula/dependencybase/DependencyManagement.kt index 669ad40..95c7e56 100644 --- a/src/main/kotlin/com/netflix/nebula/dependencybase/DependencyManagement.kt +++ b/src/main/kotlin/com/netflix/nebula/dependencybase/DependencyManagement.kt @@ -38,9 +38,7 @@ class DependencyManagement { if (shouldStoreReason) reasons.add(DefaultReason(configuration, coordinate, message)) } - fun addPluginMessage(message: String) { - if (shouldStoreReason) pluginMessages.add(message) - } + fun addPluginMessage(message: String) = if (shouldStoreReason) pluginMessages.add(message) else false fun getReason(configuration: String, coordinate: String): String { val recs = reasons.filter { it.configuration == configuration && it.coordinate == coordinate }.distinct().reversed() diff --git a/src/test/groovy/com/netflix/nebula/dependencybase/DependencyManagementSpec.groovy b/src/test/groovy/com/netflix/nebula/dependencybase/DependencyManagementSpec.groovy index 19c7866..f96ad25 100644 --- a/src/test/groovy/com/netflix/nebula/dependencybase/DependencyManagementSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/dependencybase/DependencyManagementSpec.groovy @@ -79,4 +79,15 @@ class DependencyManagementSpec extends Specification { then: management.getReason("compile", coordinate) == "recommend 1.2.0 via OtherRecommender, forced" } + + def "plugin messages are stored"() { + given: + def management = new DependencyManagement() + + when: + management.addPluginMessage("message 1") + + then: + management.pluginMessages.size() == 1 + } }