@Test
public void testQueryError() {

    String[] params = {"p1", "param2"};
    String errorMessage = "Message with params {}='p1' {}='param2'.";
    String errorCode = "io.vantiq.extjsdk.ExampleErrorName";
    
    markWsConnected(true);
    client.sendQueryError(queryAddress, errorCode, errorMessage, params);
    
    assert socket.compareData("headers." + ExtensionServiceMessage.RESPONSE_ADDRESS_HEADER, queryAddress);
    assert socket.compareData("status", 400);
    // The ArrayList creation is necessary since JSON interprets arrays as ArrayList
    assert socket.compareData("body.parameters", new ArrayList<String>(Arrays.asList(params)));
    assert socket.compareData("body.messageTemplate", errorMessage);
    assert socket.compareData("body.messageCode", errorCode);
}