Skip to content

Commit

Permalink
Support naming multiple roles in procedure annotation
Browse files Browse the repository at this point in the history
The `allowed` attribute is now an array of strings, each mentioning a role name
that gives its users access to the procedure regardless of their normal access privileges.
  • Loading branch information
Mats-SX committed Aug 31, 2016
1 parent 63ff323 commit cfdad78
Show file tree
Hide file tree
Showing 21 changed files with 89 additions and 80 deletions.
Expand Up @@ -36,17 +36,17 @@ sealed trait ProcedureCallMode {


def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]]


val allowed: String val allowed: Array[String]
} }


case class LazyReadOnlyCallMode(allowed: String) extends ProcedureCallMode { case class LazyReadOnlyCallMode(allowed: Array[String]) extends ProcedureCallMode {
override val queryType: InternalQueryType = READ_ONLY override val queryType: InternalQueryType = READ_ONLY


override def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] = override def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] =
ctx.callReadOnlyProcedure(name, args, allowed) ctx.callReadOnlyProcedure(name, args, allowed)
} }


case class EagerReadWriteCallMode(allowed: String) extends ProcedureCallMode { case class EagerReadWriteCallMode(allowed: Array[String]) extends ProcedureCallMode {
override val queryType: InternalQueryType = READ_WRITE override val queryType: InternalQueryType = READ_WRITE


override def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] = { override def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] = {
Expand All @@ -59,7 +59,7 @@ case class EagerReadWriteCallMode(allowed: String) extends ProcedureCallMode {
} }
} }


case class SchemaWriteCallMode(allowed: String) extends ProcedureCallMode { case class SchemaWriteCallMode(allowed: Array[String]) extends ProcedureCallMode {
override val queryType: InternalQueryType = SCHEMA_WRITE override val queryType: InternalQueryType = SCHEMA_WRITE


override def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] = { override def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] = {
Expand All @@ -72,7 +72,7 @@ case class SchemaWriteCallMode(allowed: String) extends ProcedureCallMode {
} }
} }


case class DbmsCallMode(allowed: String) extends ProcedureCallMode { case class DbmsCallMode(allowed: Array[String]) extends ProcedureCallMode {
override val queryType: InternalQueryType = DBMS override val queryType: InternalQueryType = DBMS


override def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] = { override def call(ctx: QueryContext, name: QualifiedProcedureName, args: Seq[Any]): Iterator[Array[AnyRef]] = {
Expand Down
Expand Up @@ -181,16 +181,16 @@ class DelegatingQueryContext(val inner: QueryContext) extends QueryContext {
filters: Seq[KernelPredicate[PropertyContainer]]): Iterator[Path] = filters: Seq[KernelPredicate[PropertyContainer]]): Iterator[Path] =
manyDbHits(inner.allShortestPath(left, right, depth, expander, pathPredicate, filters)) manyDbHits(inner.allShortestPath(left, right, depth, expander, pathPredicate, filters))


override def callReadOnlyProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: String) = override def callReadOnlyProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: Array[String]) =
singleDbHit(inner.callReadOnlyProcedure(name, args, allowed)) singleDbHit(inner.callReadOnlyProcedure(name, args, allowed))


override def callReadWriteProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: String) = override def callReadWriteProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: Array[String]) =
singleDbHit(inner.callReadWriteProcedure(name, args, allowed)) singleDbHit(inner.callReadWriteProcedure(name, args, allowed))


override def callSchemaWriteProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: String) = override def callSchemaWriteProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: Array[String]) =
singleDbHit(inner.callSchemaWriteProcedure(name, args, allowed)) singleDbHit(inner.callSchemaWriteProcedure(name, args, allowed))


override def callDbmsProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: String) = override def callDbmsProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: Array[String]) =
inner.callDbmsProcedure(name, args, allowed) inner.callDbmsProcedure(name, args, allowed)


override def isGraphKernelResultValue(v: Any): Boolean = override def isGraphKernelResultValue(v: Any): Boolean =
Expand Down
Expand Up @@ -47,7 +47,7 @@ case class FieldSignature(name: String, typ: CypherType, default: Option[CypherV


sealed trait ProcedureAccessMode sealed trait ProcedureAccessMode


case class ProcedureReadOnlyAccess(allowed: String) extends ProcedureAccessMode case class ProcedureReadOnlyAccess(allowed: Array[String]) extends ProcedureAccessMode
case class ProcedureReadWriteAccess(allowed: String) extends ProcedureAccessMode case class ProcedureReadWriteAccess(allowed: Array[String]) extends ProcedureAccessMode
case class ProcedureSchemaWriteAccess(allowed: String) extends ProcedureAccessMode case class ProcedureSchemaWriteAccess(allowed: Array[String]) extends ProcedureAccessMode
case class ProcedureDbmsAccess(allowed: String) extends ProcedureAccessMode case class ProcedureDbmsAccess(allowed: Array[String]) extends ProcedureAccessMode
Expand Up @@ -156,13 +156,13 @@ trait QueryContext extends TokenContext {


def lockRelationships(relIds: Long*) def lockRelationships(relIds: Long*)


def callReadOnlyProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: String): Iterator[Array[AnyRef]] def callReadOnlyProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: Array[String]): Iterator[Array[AnyRef]]


def callReadWriteProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: String): Iterator[Array[AnyRef]] def callReadWriteProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: Array[String]): Iterator[Array[AnyRef]]


def callSchemaWriteProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: String): Iterator[Array[AnyRef]] def callSchemaWriteProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: Array[String]): Iterator[Array[AnyRef]]


def callDbmsProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: String): Iterator[Array[AnyRef]] def callDbmsProcedure(name: QualifiedProcedureName, args: Seq[Any], allowed: Array[String]): Iterator[Array[AnyRef]]


// Check if a runtime value is a node, relationship, path or some such value returned from // Check if a runtime value is a node, relationship, path or some such value returned from
// other query context values by calling down to the underlying database // other query context values by calling down to the underlying database
Expand Down
Expand Up @@ -32,7 +32,7 @@ class RewriteProcedureCallsTest extends CypherFunSuite with AstConstructionTestS
val qualifiedName = QualifiedProcedureName(ns.parts, name.name) val qualifiedName = QualifiedProcedureName(ns.parts, name.name)
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty[String]))
val lookup: (QualifiedProcedureName) => ProcedureSignature = _ => signature val lookup: (QualifiedProcedureName) => ProcedureSignature = _ => signature


test("should resolve standalone procedure calls") { test("should resolve standalone procedure calls") {
Expand Down
Expand Up @@ -35,7 +35,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
val unresolved = UnresolvedCall(ns, name, None, None)(pos) val unresolved = UnresolvedCall(ns, name, None, None)(pos)
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq(ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("y"))(pos)) val callResults = Seq(ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("y"))(pos))


Expand All @@ -60,7 +60,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
val unresolved = UnresolvedCall(ns, name, None, None)(pos) val unresolved = UnresolvedCall(ns, name, None, None)(pos)
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = None val signatureOutputs = None
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq.empty val callResults = Seq.empty


Expand All @@ -84,7 +84,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("should resolve CALL my.proc.foo YIELD x, y") { test("should resolve CALL my.proc.foo YIELD x, y") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq(ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("y"))(pos)) val callResults = Seq(ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("y"))(pos))
val unresolved = UnresolvedCall(ns, name, None, Some(callResults))(pos) val unresolved = UnresolvedCall(ns, name, None, Some(callResults))(pos)
Expand All @@ -109,7 +109,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("should resolve CALL my.proc.foo(a)") { test("should resolve CALL my.proc.foo(a)") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq(ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("y"))(pos)) val callResults = Seq(ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("y"))(pos))
val unresolved = UnresolvedCall(ns, name, Some(callArguments), None)(pos) val unresolved = UnresolvedCall(ns, name, Some(callArguments), None)(pos)
Expand All @@ -134,7 +134,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("should resolve void CALL my.proc.foo(a)") { test("should resolve void CALL my.proc.foo(a)") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = None val signatureOutputs = None
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq.empty val callResults = Seq.empty
val unresolved = UnresolvedCall(ns, name, Some(callArguments), None)(pos) val unresolved = UnresolvedCall(ns, name, Some(callArguments), None)(pos)
Expand All @@ -159,7 +159,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("should resolve CALL my.proc.foo(a) YIELD x, y AS z") { test("should resolve CALL my.proc.foo(a) YIELD x, y AS z") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq( val callResults = Seq(
ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("x"))(pos),
Expand All @@ -183,7 +183,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
} }


test("pretends to be based on user-declared arguments and results upon request") { test("pretends to be based on user-declared arguments and results upon request") {
val signature = ProcedureSignature(qualifiedName, IndexedSeq.empty, Some(IndexedSeq.empty), None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, IndexedSeq.empty, Some(IndexedSeq.empty), None, ProcedureReadOnlyAccess(Array.empty))
val call = ResolvedCall(signature, null, null, declaredArguments = false, declaredResults = false)(pos) val call = ResolvedCall(signature, null, null, declaredArguments = false, declaredResults = false)(pos)


call.withFakedFullDeclarations.declaredArguments should be(true) call.withFakedFullDeclarations.declaredArguments should be(true)
Expand All @@ -193,7 +193,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("adds coercion of arguments to signature types upon request") { test("adds coercion of arguments to signature types upon request") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq( val callResults = Seq(
ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("x"))(pos),
Expand All @@ -220,7 +220,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("should verify number of arguments during semantic checking of resolved calls") { test("should verify number of arguments during semantic checking of resolved calls") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq.empty val callArguments = Seq.empty
val callResults = Seq( val callResults = Seq(
ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("x"))(pos),
Expand All @@ -237,7 +237,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("should verify that result variables are unique during semantic checking of resolved calls") { test("should verify that result variables are unique during semantic checking of resolved calls") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq( val callResults = Seq(
ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("x"))(pos),
Expand All @@ -254,7 +254,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("should verify that output field names are correct during semantic checking of resolved calls") { test("should verify that output field names are correct during semantic checking of resolved calls") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(Parameter("a", CTAny)(pos)) val callArguments = Seq(Parameter("a", CTAny)(pos))
val callResults = Seq( val callResults = Seq(
ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("x"))(pos),
Expand All @@ -271,7 +271,7 @@ class CallClauseTest extends CypherFunSuite with AstConstructionTestSupport {
test("should verify result types during semantic checking of resolved calls") { test("should verify result types during semantic checking of resolved calls") {
val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger)) val signatureInputs = IndexedSeq(FieldSignature("a", CTInteger))
val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode)))) val signatureOutputs = Some(IndexedSeq(FieldSignature("x", CTInteger), FieldSignature("y", CTList(CTNode))))
val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess("")) val signature = ProcedureSignature(qualifiedName, signatureInputs, signatureOutputs, None, ProcedureReadOnlyAccess(Array.empty))
val callArguments = Seq(StringLiteral("nope")(pos)) val callArguments = Seq(StringLiteral("nope")(pos))
val callResults = Seq( val callResults = Seq(
ProcedureResultItem(varFor("x"))(pos), ProcedureResultItem(varFor("x"))(pos),
Expand Down
Expand Up @@ -883,7 +883,7 @@ class StatementConvertersTest extends CypherFunSuite with LogicalPlanningTestSup
inputSignature = IndexedSeq.empty, inputSignature = IndexedSeq.empty,
deprecationInfo = None, deprecationInfo = None,
outputSignature = Some(IndexedSeq(FieldSignature("all", CTInteger))), outputSignature = Some(IndexedSeq(FieldSignature("all", CTInteger))),
accessMode = ProcedureReadOnlyAccess("") accessMode = ProcedureReadOnlyAccess(Array.empty)
) )
val query = buildPlannerQuery("CALL foo() YIELD all RETURN all", Some(_ => signature)) val query = buildPlannerQuery("CALL foo() YIELD all RETURN all", Some(_ => signature))


Expand Down
Expand Up @@ -86,15 +86,15 @@ class ProcedureCallExecutionPlanTest extends CypherFunSuite {
IndexedSeq(FieldSignature("a", symbols.CTInteger)), IndexedSeq(FieldSignature("a", symbols.CTInteger)),
Some(IndexedSeq(FieldSignature("b", symbols.CTInteger))), Some(IndexedSeq(FieldSignature("b", symbols.CTInteger))),
None, None,
ProcedureReadOnlyAccess("") ProcedureReadOnlyAccess(Array.empty)
) )


private val writeSignature = ProcedureSignature( private val writeSignature = ProcedureSignature(
QualifiedProcedureName(Seq.empty, "foo"), QualifiedProcedureName(Seq.empty, "foo"),
IndexedSeq(FieldSignature("a", symbols.CTInteger)), IndexedSeq(FieldSignature("a", symbols.CTInteger)),
Some(IndexedSeq(FieldSignature("b", symbols.CTInteger))), Some(IndexedSeq(FieldSignature("b", symbols.CTInteger))),
None, None,
ProcedureReadWriteAccess("") ProcedureReadWriteAccess(Array.empty)
) )


private val pos = DummyPosition(-1) private val pos = DummyPosition(-1)
Expand All @@ -116,6 +116,6 @@ class ProcedureCallExecutionPlanTest extends CypherFunSuite {
} }


when(ctx.transactionalContext).thenReturn(mock[QueryTransactionalContext]) when(ctx.transactionalContext).thenReturn(mock[QueryTransactionalContext])
when(ctx.callReadOnlyProcedure(any[QualifiedProcedureName], any[Seq[Any]], any[String])).thenAnswer(procedureResult) when(ctx.callReadOnlyProcedure(any[QualifiedProcedureName], any[Seq[Any]], any[Array[String]])).thenAnswer(procedureResult)
when(ctx.callReadWriteProcedure(any[QualifiedProcedureName], any[Seq[Any]], any[String])).thenAnswer(procedureResult) when(ctx.callReadWriteProcedure(any[QualifiedProcedureName], any[Seq[Any]], any[Array[String]])).thenAnswer(procedureResult)
} }

0 comments on commit cfdad78

Please sign in to comment.