Search in sources :

Example 1 with NTString

use of org.neo4j.kernel.api.proc.Neo4jTypes.NTString in project neo4j by neo4j.

the class ListConverterTest method shouldHandleDoubleQuotedValue.

@Test
public void shouldHandleDoubleQuotedValue() {
    // Given
    ListConverter converter = new ListConverter(String.class, NTString);
    String listString = "[\"foo\", \"bar\"]";
    // When
    Neo4jValue converted = converter.apply(listString);
    // Then
    assertThat(converted, equalTo(ntList(asList("foo", "bar"), NTString)));
}
Also used : NTString(org.neo4j.kernel.api.proc.Neo4jTypes.NTString) Test(org.junit.Test)

Example 2 with NTString

use of org.neo4j.kernel.api.proc.Neo4jTypes.NTString in project neo4j by neo4j.

the class ListConverterTest method shouldHandleEmptyListWithSpaces.

@Test
public void shouldHandleEmptyListWithSpaces() {
    // Given
    ListConverter converter = new ListConverter(String.class, NTString);
    String listString = " [  ]   ";
    // When
    Neo4jValue converted = converter.apply(listString);
    // Then
    assertThat(converted, equalTo(ntList(emptyList(), NTString)));
}
Also used : NTString(org.neo4j.kernel.api.proc.Neo4jTypes.NTString) Test(org.junit.Test)

Example 3 with NTString

use of org.neo4j.kernel.api.proc.Neo4jTypes.NTString in project neo4j by neo4j.

the class ListConverterTest method shouldHandleSingleQuotedValue.

@Test
public void shouldHandleSingleQuotedValue() {
    // Given
    ListConverter converter = new ListConverter(String.class, NTString);
    String listString = "['foo', 'bar']";
    // When
    Neo4jValue converted = converter.apply(listString);
    // Then
    assertThat(converted, equalTo(ntList(asList("foo", "bar"), NTString)));
}
Also used : NTString(org.neo4j.kernel.api.proc.Neo4jTypes.NTString) Test(org.junit.Test)

Example 4 with NTString

use of org.neo4j.kernel.api.proc.Neo4jTypes.NTString in project neo4j by neo4j.

the class ListConverterTest method shouldHandleNullString.

@Test
public void shouldHandleNullString() {
    // Given
    ListConverter converter = new ListConverter(String.class, NTString);
    String listString = "null";
    // When
    Neo4jValue converted = converter.apply(listString);
    // Then
    assertThat(converted, equalTo(ntList(null, NTString)));
}
Also used : NTString(org.neo4j.kernel.api.proc.Neo4jTypes.NTString) Test(org.junit.Test)

Example 5 with NTString

use of org.neo4j.kernel.api.proc.Neo4jTypes.NTString in project neo4j by neo4j.

the class ListConverterTest method shouldHandleEmptyList.

@Test
public void shouldHandleEmptyList() {
    // Given
    ListConverter converter = new ListConverter(String.class, NTString);
    String listString = "[]";
    // When
    Neo4jValue converted = converter.apply(listString);
    // Then
    assertThat(converted, equalTo(ntList(emptyList(), NTString)));
}
Also used : NTString(org.neo4j.kernel.api.proc.Neo4jTypes.NTString) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)5 NTString (org.neo4j.kernel.api.proc.Neo4jTypes.NTString)5