Search in sources :

Example 11 with CompilationMessage

use of org.neo4j.tooling.procedure.messages.CompilationMessage in project neo4j by neo4j.

the class UserFunctionVisitorTest method functions_with_unsupported_parameter_types_are_invalid.

@Test
public void functions_with_unsupported_parameter_types_are_invalid() {
    Element function = elementTestUtils.findMethodElement(UserFunctionsExamples.class, "wrongParameterType");
    Stream<CompilationMessage> errors = visitor.visit(function);
    assertThat(errors).hasSize(1).extracting(CompilationMessage::getCategory, CompilationMessage::getContents).contains(tuple(Diagnostic.Kind.ERROR, "Unsupported parameter type <java.lang.Thread> of procedure|function " + "UserFunctionsExamples#wrongParameterType"));
}
Also used : Element(javax.lang.model.element.Element) CompilationMessage(org.neo4j.tooling.procedure.messages.CompilationMessage) Test(org.junit.Test)

Aggregations

Element (javax.lang.model.element.Element)11 Test (org.junit.Test)11 CompilationMessage (org.neo4j.tooling.procedure.messages.CompilationMessage)11 TypeElement (javax.lang.model.element.TypeElement)2 DefaultProcedureA (org.neo4j.tooling.procedure.validators.examples.DefaultProcedureA)1 DefaultProcedureB (org.neo4j.tooling.procedure.validators.examples.DefaultProcedureB)1 OverriddenProcedureB (org.neo4j.tooling.procedure.validators.examples.OverriddenProcedureB)1 OverriddenProcedureA (org.neo4j.tooling.procedure.validators.examples.override.OverriddenProcedureA)1