JMeterVariables vars = new JMeterVariables();
vars.put("title_prefix", "a test\u00c5");
vars.put("description_suffix", "the_end");
JMeterContextService.getContext().setVariables(vars);
JMeterContextService.getContext().setSamplingStarted(true);
ValueReplacer replacer = new ValueReplacer();
replacer.setUserDefinedVariables(testPlan.getUserDefinedVariables());
sampler = createHttpSampler(samplerType);
contentEncoding = "UTF-8";
titleValue = "${title_prefix}mytitle\u0153\u20a1\u0115\u00c5";
descriptionValue = "mydescription\u0153\u20a1\u0115\u00c5${description_suffix}";
setupUrl(sampler, contentEncoding);
setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);
((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);
((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);
// Replace the variables in the sampler
replacer.replaceValues(sampler);
res = executeSampler(sampler);
String expectedTitleValue = "a test\u00c5mytitle\u0153\u20a1\u0115\u00c5";
String expectedDescriptionValue = "mydescription\u0153\u20a1\u0115\u00c5the_end";
expectedPostBody = expectedTitleValue+ expectedDescriptionValue;
checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody);