public void testProcessFieldNames() throws Exception {
MergeFieldsStage mfs = new MergeFieldsStage();
mfs.setOutputField("out");
mfs.setFromFields(Arrays.asList("in1", "in2", "in3"));
LocalDocument doc = getDocument();
doc.putContentField("out", "xyz");
LocalDocument doc2 = new LocalDocument(doc);
mfs.process(doc2);
Assert.assertEquals(doc.getContentField("in1"), doc2.getContentField("in1"));
Assert.assertEquals(doc.getContentField("in2"), doc2.getContentField("in2"));
Assert.assertEquals(doc.getContentField("in3"), doc2.getContentField("in3"));
String[] outString = doc2.getContentField("out").toString().split(" ");
Assert.assertEquals(4, outString.length);
for(String s : outString) {
Assert.assertTrue(hasValue(doc, s));
}