|
25 | 25 | package io.jenkins.plugins.file_parameters; |
26 | 26 |
|
27 | 27 | import hudson.cli.CLICommandInvoker; |
| 28 | +import hudson.model.FreeStyleBuild; |
| 29 | +import hudson.model.FreeStyleProject; |
| 30 | +import hudson.model.ParametersAction; |
28 | 31 | import hudson.model.ParametersDefinitionProperty; |
| 32 | +import hudson.tasks.Shell; |
29 | 33 | import jenkins.model.Jenkins; |
30 | 34 | import org.apache.commons.io.FileUtils; |
31 | 35 | import org.htmlunit.FormEncodingType; |
|
54 | 58 | import java.util.Collections; |
55 | 59 |
|
56 | 60 | import static org.hamcrest.MatcherAssert.assertThat; |
| 61 | +import static org.hamcrest.Matchers.containsString; |
57 | 62 | import static org.hamcrest.Matchers.is; |
58 | 63 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
59 | 64 |
|
@@ -152,4 +157,20 @@ void buildStep(JenkinsRule r) throws Exception { |
152 | 157 | r.assertLogContains("got a message", b); |
153 | 158 | } |
154 | 159 |
|
| 160 | + @Issue("https://github.com/jenkinsci/file-parameters-plugin/issues/116") |
| 161 | + @Test |
| 162 | + void freestyleWithShellStep(JenkinsRule r) throws Exception { |
| 163 | + FreeStyleProject project = r.createFreeStyleProject("test-base64-freestyle"); |
| 164 | + project.addProperty(new ParametersDefinitionProperty(new Base64FileParameterDefinition("FILE"))); |
| 165 | + project.getBuildersList().add(new Shell("echo \"FILE=$FILE\"")); |
| 166 | + |
| 167 | + Base64FileParameterValue paramValue = new Base64FileParameterValue("FILE"); |
| 168 | + paramValue.setBase64("amVua2lucwo="); |
| 169 | + |
| 170 | + FreeStyleBuild build = project.scheduleBuild2(0, new ParametersAction(paramValue)).get(); |
| 171 | + |
| 172 | + r.assertBuildStatusSuccess(build); |
| 173 | + r.assertLogContains("FILE=amVua2lucwo=", build); |
| 174 | + } |
| 175 | + |
155 | 176 | } |
0 commit comments