use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.
the class ListConverterTest method shouldHandleBooleanValues.
@Test
void shouldHandleBooleanValues() {
// Given
ListConverter converter = new ListConverter(Boolean.class, NTBoolean, expressionEvaluator());
String mapString = "[false, true]";
// When
DefaultParameterValue converted = converter.apply(mapString);
// Then
assertThat(converted).isEqualTo(ntList(asList(false, true), NTBoolean));
}
use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.
the class ListConverterTest method shouldPassOnValidMixedTypes.
@Test
void shouldPassOnValidMixedTypes() {
// Given
ListConverter converter = new ListConverter(Object.class, NTAny, expressionEvaluator());
String listString = "[1337, 'forty-two']";
// When
DefaultParameterValue value = converter.apply(listString);
// Then
assertThat(value).isEqualTo(ntList(asList(1337L, "forty-two"), NTAny));
}
use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.
the class ListConverterTest method shouldHandleSingleQuotedValue.
@Test
void shouldHandleSingleQuotedValue() {
// Given
ListConverter converter = new ListConverter(String.class, NTString, expressionEvaluator());
String listString = "['foo', 'bar']";
// When
DefaultParameterValue converted = converter.apply(listString);
// Then
assertThat(converted).isEqualTo(ntList(asList("foo", "bar"), NTString));
}
use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.
the class ListConverterTest method shouldHandleNullValue.
@Test
void shouldHandleNullValue() {
// Given
ListConverter converter = new ListConverter(Double.class, NTFloat, expressionEvaluator());
String listString = "[null]";
// When
DefaultParameterValue converted = converter.apply(listString);
// Then
assertThat(converted).isEqualTo(ntList(singletonList(null), NTFloat));
}
use of org.neo4j.internal.kernel.api.procs.DefaultParameterValue in project neo4j by neo4j.
the class ListConverterTest method shouldHandleDoubleQuotedValue.
@Test
void shouldHandleDoubleQuotedValue() {
// Given
ListConverter converter = new ListConverter(String.class, NTString, expressionEvaluator());
String listString = "[\"foo\", \"bar\"]";
// When
DefaultParameterValue converted = converter.apply(listString);
// Then
assertThat(converted).isEqualTo(ntList(asList("foo", "bar"), NTString));
}
Aggregations