Add functional test showing immutable properties
Issue
@@ -2,6 +2,7 @@ package com.bmuschko.gradle.docker.tasks.container
import com.bmuschko.gradle.docker.AbstractGroovyDslFunctionalTest
import org.gradle.testkit.runner.BuildResult
+import spock.lang.Unroll
class DockerLivenessFunctionalTest extends AbstractGroovyDslFunctionalTest {
@@ -106,6 +107,28 @@ class DockerLivenessFunctionalTest extends AbstractGroovyDslFunctionalTest {
result.output.contains("is not running and so can't perform liveness")
}
+ @Unroll
+ def "Probe cannot configure all fields from DockerLogsContainer"() {
+ String additionalTasks = """
+ task livenessProbe(type: DockerLivenessContainer) {
+ $property = $value
+ }
+ """
+ buildFile << containerUsage(additionalTasks)
+
+ when:
+ BuildResult result = buildAndFail('livenessProbe')
+
+ then:
+ result.output.contains("The value for this property is final and cannot be changed any further.")
+
+ where:
+ property | value
+ 'tailAll' | false
+ 'tailCount' | 10
+ 'follow' | true
+ }
+
static String containerUsage(String additionalTasks) {
"""
import com.bmuschko.gradle.docker.tasks.image.DockerPullImage
