@FixFor( "MODE-2062" )
@Test
public void fullTextShouldWorkWithBindVar() throws Exception {

    Node n1 = session.getRootNode().addNode("n1");
    n1.setProperty("n1-prop-1", "wow");
    n1.setProperty("n1-prop-2", "any");
    Node n2 = session.getRootNode().addNode("n2");
    n2.setProperty("n2-prop-1", "test");
    try {
        session.save();
        // test with literal
        String queryString = "select * from [nt:unstructured] as a where contains(a.*, 'wow')";
        assertNodesAreFound(queryString, Query.JCR_SQL2, "/n1");
        // test with bind
        String queryStringWithBind = "select * from [nt:unstructured] as a where contains(a.*, $text)";
        QueryManager queryManager = session.getWorkspace().getQueryManager();
        Query query = queryManager.createQuery(queryStringWithBind, Query.JCR_SQL2);
        query.bindValue("text", session.getValueFactory().createValue("wow"));
        QueryResult result = query.execute();
        validateQuery().rowCount(1).hasNodesAtPaths("/n1").validate(query, result);
    } finally {
        n1.remove();
        n2.remove();
        session.save();
    }
}