Add test cases for wfAppendQuery

Change-Id: I51e0e1764ad70d922466d62f1ddf3f8e3fb4568f