Added test for query method