// Merge in predefined: BAZ=moo HOHO=blah
// Expected result: FOO=bar BAR=foo BAZ=moo HOHO=blah
projectB.addProperty(new ParametersDefinitionProperty(
new StringParameterDefinition("FOO", "bar"),
new StringParameterDefinition("BAR", "override-me")));
CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();
projectB.getBuildersList().add(builder);
projectB.setQuietPeriod(1);
projectA.getPublishersList().add(new BuildTrigger(
new BuildTriggerConfig("projectB", ResultCondition.SUCCESS,
new CurrentBuildParameters(),
new PredefinedBuildParameters("BAZ=moo\nHOHO=blah"))));
hudson.rebuildDependencyGraph();
Run r = (Run)projectA.scheduleBuild2(0, new UserCause(), new ParametersAction(
new StringParameterValue("BAR", "foo"),
new StringParameterValue("BAZ", "override-me"))).get();
Queue.Item q = hudson.getQueue().getItem(projectB);
assertNotNull("projectB should be triggered: " + getLog(r), q);
r = (Run)q.getFuture().get();
assertEquals("should be exactly one ParametersAction", 1,
r.getActions(ParametersAction.class).size());
EnvVars envVars = builder.getEnvVars();
assertNotNull("builder should record environment", envVars);
assertEquals("FOO", "bar", envVars.get("FOO"));
assertEquals("BAR", "foo", envVars.get("BAR"));
assertEquals("BAZ", "moo", envVars.get("BAZ"));
assertEquals("HOHO", "blah", envVars.get("HOHO"));