@Test public void rejectQueryFileOutsideOfProjectPath() throws Exception { Path projectPath = Paths.get("").normalize().toAbsolutePath(); Config config = newConfig() .set("_command", projectPath.resolve("..").resolve("parent.sql").toString()); exception.expectMessage("File name must not be outside of project path"); newOperatorFactory(TdOperatorFactory.class) .newOperator(newContext(projectPath, newTaskRequest().withConfig(config))); }
@Override public Operator newOperator(OperatorContext context) { return new TdOperator(context); }
TdOperatorFactory implements OperatorFactory { @Override public Operator newOperator(OperatorContext context) { return new TdOperator(context); } }
TdOperatorFactory implements OperatorFactory { @Override public Operator newOperator(OperatorContext context) { return new TdOperator(context); } @Inject  TdOperatorFactory(TemplateEngine templateEngine, @Environment Map<String, String> env, Config systemConfig); }
TdOperatorFactory implements OperatorFactory { @Override public Operator newOperator(OperatorContext context) { return new TdOperator(context); } @Inject  TdOperatorFactory(TemplateEngine templateEngine, @Environment Map<String, String> env, Config systemConfig); String getType(); @Override Operator newOperator(OperatorContext context); }
TdOperatorFactory implements OperatorFactory { @Override public Operator newOperator(OperatorContext context) { return new TdOperator(context); } @Inject  TdOperatorFactory(TemplateEngine templateEngine, @Environment Map<String, String> env, Config systemConfig); String getType(); @Override Operator newOperator(OperatorContext context);  }