Removing PullRequestTask configuration from Shipkit Configuration - Tests for both defaults and overrided values
@@ -166,6 +166,27 @@ class UpgradeDependencyPluginTest extends PluginSpecification {
conf.gitHub.apiUrl = "http://api.com"
conf.gitHub.repository = "mockito/mockito"
conf.gitHub.writeAuthToken = "writeToken"
+ when:
+ def versionUpgrade = project.plugins.apply(UpgradeDependencyPlugin).upgradeDependencyExtension
+ CreatePullRequestTask task = project.tasks.createPullRequest
+ task.setProperty("pullRequestDescription", "Custom Description")
+ task.setProperty("pullRequestTitle", "Custom Title")
+
+ then:
+ task.gitHubApiUrl == "http://api.com"
+ task.authToken == "writeToken"
+ task.authToken == "writeToken"
+ task.versionUpgrade == versionUpgrade
+ task.pullRequestDescription == "Custom Description"
+ task.pullRequestTitle == "Custom Title"
+ }
+
+ def "should configure createPullRequest with default values"() {
+ given:
+ project.extensions.dependency = "org.shipkit:shipkit:1.2.30"
+ conf.gitHub.apiUrl = "http://api.com"
+ conf.gitHub.repository = "mockito/mockito"
+ conf.gitHub.writeAuthToken = "writeToken"
when:
def versionUpgrade = project.plugins.apply(UpgradeDependencyPlugin).upgradeDependencyExtension
@@ -176,5 +197,9 @@ class UpgradeDependencyPluginTest extends PluginSpecification {
task.authToken == "writeToken"
task.versionUpgrade == versionUpgrade
task.versionBranch == "upgrade-shipkit-to-1.2.30"
+ task.pullRequestDescription == "This pull request was automatically created by " +
+ "Shipkit's 'org.shipkit.upgrade-downstream' Gradle plugin (http://shipkit.org). " +
+ "Please merge it so that you are using fresh version of 'shipkit' dependency."
+ task.pullRequestTitle == "Version of shipkit upgraded to ${versionUpgrade.newVersion}"
}
}
