Search in sources :

Example 16 with DefaultParameterValue

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

the class MapConverterTest method shouldHandleEmptyMap.

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

Example 17 with DefaultParameterValue

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

the class MapConverterTest method shouldHandleKeyWithEscapedDoubleQuote.

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

Example 18 with DefaultParameterValue

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

the class MapConverterTest method shouldHandleTrueValue.

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

Example 19 with DefaultParameterValue

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

the class MapConverterTest method shouldHandleMultipleKeys.

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

Example 20 with DefaultParameterValue

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

the class MapConverterTest method shouldHandleFloatValue.

@Test
void shouldHandleFloatValue() {
    // Given
    String mapString = "{key: 2.718281828}";
    // When
    DefaultParameterValue converted = converter.apply(mapString);
    // Then
    assertThat(converted).isEqualTo(ntMap(map("key", 2.718281828)));
}
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