Skip to content

Commit

Permalink
chore: Add dedicated test for retrieving element ids and ids. (#531)
Browse files Browse the repository at this point in the history
Closes #398.
  • Loading branch information
michael-simons authored Mar 1, 2024
1 parent 62807a6 commit f49786a
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.junit.jupiter.params.provider.CsvSource;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.neo4j.jdbc.values.Value;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
Expand Down Expand Up @@ -204,6 +205,20 @@ void executeShouldAutomaticallyTranslate() throws SQLException {
}
}

// GH-398
@SuppressWarnings("deprecation")
@Test
void elementIdAndIdShouldBeSupported() throws SQLException {
try (var connection = getConnection();
var stmt = connection.createStatement();
var result = stmt.executeQuery("CREATE (n:Test) RETURN n")) {
assertThat(result.next()).isTrue();
var node = result.getObject(1, Value.class).asNode();
assertThat(node.elementId()).isNotNull();
assertThat(node.id()).isNotNull();
}
}

@Test
void orderOrGroupByUnrelated() throws SQLException {

Expand Down

0 comments on commit f49786a

Please sign in to comment.