Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions driver/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,10 @@
<differenceType>3003</differenceType>
</difference>

<difference>
<className>org/neo4j/driver/types/TypeSystem</className>
<differenceType>7012</differenceType>
<method>org.neo4j.driver.types.TypeSystem getDefault()</method>
</difference>

</differences>
11 changes: 11 additions & 0 deletions driver/src/main/java/org/neo4j/driver/types/TypeSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.neo4j.driver.types;

import static org.neo4j.driver.internal.types.InternalTypeSystem.TYPE_SYSTEM;

import org.neo4j.driver.util.Experimental;
import org.neo4j.driver.util.Immutable;

Expand All @@ -28,6 +30,15 @@
@Immutable
@Experimental
public interface TypeSystem {
/**
* Returns an instance of type system.
*
* @return instance of type system
*/
static TypeSystem getDefault() {
return TYPE_SYSTEM;
}

Type ANY();

Type BOOLEAN();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.junit.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.neo4j.driver.Values.value;
import static org.neo4j.driver.internal.types.InternalTypeSystem.TYPE_SYSTEM;

Expand Down Expand Up @@ -75,6 +76,11 @@ private TypeVerifier newTypeVerifierFor(Type type) {
return new TypeVerifier(type, allValues);
}

@Test
void shouldReturnTypeSystem() {
assertEquals(TYPE_SYSTEM, TypeSystem.getDefault());
}

@Test
void shouldNameTypeCorrectly() {
assertThat(TYPE_SYSTEM.ANY().name(), is("ANY"));
Expand Down