Search in sources :

Example 26 with DefaultParameterValue

use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.

the class ListConverterTest method shouldHandleNullString.

@Test
void shouldHandleNullString() {
    // Given
    ListConverter converter = new ListConverter(String.class, NTString, expressionEvaluator());
    String listString = "null";
    // When
    DefaultParameterValue converted = converter.apply(listString);
    // Then
    assertThat(converted).isEqualTo(ntList(null, NTString));
}
Also used : DefaultParameterValue(org.neo4j.internal.kernel.api.procs.DefaultParameterValue) NTString(org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTString) Test(org.junit.jupiter.api.Test)

Example 27 with DefaultParameterValue

use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.

the class MapConverterTest method shouldHandleIntegerValue.

@Test
void shouldHandleIntegerValue() {
    // Given
    String mapString = "{key: 1337}";
    // When
    DefaultParameterValue converted = converter.apply(mapString);
    // Then
    assertThat(converted).isEqualTo(ntMap(map("key", 1337L)));
}
Also used : DefaultParameterValue(org.neo4j.internal.kernel.api.procs.DefaultParameterValue) Test(org.junit.jupiter.api.Test)

Example 28 with DefaultParameterValue

use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.

the class MapConverterTest method shouldHandleEscapedSingleQuotedInValue2.

@Test
void shouldHandleEscapedSingleQuotedInValue2() {
    // Given
    String mapString = "{key: \"va\'lue\"}";
    // When
    DefaultParameterValue converted = converter.apply(mapString);
    // Then
    assertThat(converted).isEqualTo(ntMap(map("key", "va\'lue")));
}
Also used : DefaultParameterValue(org.neo4j.internal.kernel.api.procs.DefaultParameterValue) Test(org.junit.jupiter.api.Test)

Example 29 with DefaultParameterValue

use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.

the class MapConverterTest method shouldHandleFalseValue.

@Test
void shouldHandleFalseValue() {
    // Given
    String mapString = "{key: false}";
    // When
    DefaultParameterValue converted = converter.apply(mapString);
    // Then
    assertThat(converted).isEqualTo(ntMap(map("key", false)));
}
Also used : DefaultParameterValue(org.neo4j.internal.kernel.api.procs.DefaultParameterValue) Test(org.junit.jupiter.api.Test)

Example 30 with DefaultParameterValue

use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.

the class MapConverterTest method shouldHandleEscapedDoubleQuotedInValue2.

@Test
void shouldHandleEscapedDoubleQuotedInValue2() {
    // Given
    String mapString = "{key: 'va\"lue'}";
    // When
    DefaultParameterValue converted = converter.apply(mapString);
    // Then
    assertThat(converted).isEqualTo(ntMap(map("key", "va\"lue")));
}
Also used : DefaultParameterValue(org.neo4j.internal.kernel.api.procs.DefaultParameterValue) Test(org.junit.jupiter.api.Test)

Aggregations

DefaultParameterValue (org.neo4j.internal.kernel.api.procs.DefaultParameterValue)31 Test (org.junit.jupiter.api.Test)30 NTString (org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTString)12 Arrays.asList (java.util.Arrays.asList)2 Collections.emptyList (java.util.Collections.emptyList)2 Collections.emptyMap (java.util.Collections.emptyMap)2 Collections.singletonList (java.util.Collections.singletonList)2 List (java.util.List)2 Map (java.util.Map)2 DefaultParameterValue.ntList (org.neo4j.internal.kernel.api.procs.DefaultParameterValue.ntList)2 DefaultParameterValue.ntMap (org.neo4j.internal.kernel.api.procs.DefaultParameterValue.ntMap)2 NTList (org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTList)2 Parameter (java.lang.reflect.Parameter)1 ParameterizedType (java.lang.reflect.ParameterizedType)1 Type (java.lang.reflect.Type)1 ArrayList (java.util.ArrayList)1 ProcedureException (org.neo4j.internal.kernel.api.exceptions.ProcedureException)1 FieldSignature (org.neo4j.internal.kernel.api.procs.FieldSignature)1 Name (org.neo4j.procedure.Name)1 DefaultValueConverter (org.neo4j.procedure.impl.TypeCheckers.DefaultValueConverter)1