Add a constructor to QueryAssertions
Cherry-pick of
@@ -33,6 +33,7 @@ import static com.facebook.airlift.testing.Assertions.assertEqualsIgnoreOrder;
import static com.facebook.presto.testing.TestingSession.testSessionBuilder;
import static com.google.common.base.Strings.nullToEmpty;
import static java.lang.String.format;
+import static java.util.Objects.requireNonNull;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
@@ -63,6 +64,11 @@ class QueryAssertions
runner = new LocalQueryRunner(session);
}
+ public QueryAssertions(QueryRunner runner)
+ {
+ this.runner = requireNonNull(runner, "runner is null");
+ }
+
public QueryRunner getQueryRunner()
{
return runner;
