Search in sources :

Example 1 with TestNotification

use of org.neo4j.bolt.testing.TestNotification in project neo4j by neo4j.

the class TransportSessionIT method shouldSendNotifications.

@ParameterizedTest(name = "{displayName} {2}")
@MethodSource("argumentsProvider")
public void shouldSendNotifications(Class<? extends TransportConnection> connectionClass, Neo4jPack neo4jPack, String name) throws Exception {
    initParameters(connectionClass, neo4jPack, name);
    // When
    connection.connect(address).send(util.defaultAcceptedVersions()).send(util.defaultAuth()).send(util.defaultRunAutoCommitTx("EXPLAIN MATCH (a:THIS_IS_NOT_A_LABEL) RETURN count(*)"));
    // Then
    assertThat(connection).satisfies(util.eventuallyReceivesSelectedProtocolVersion());
    assertThat(connection).satisfies(util.eventuallyReceives(msgSuccess(), msgSuccess(), hasNotification(new TestNotification("Neo.ClientNotification.Statement.UnknownLabelWarning", "The provided label is not in the database.", "One of the labels in your query is not available in the database, " + "make sure you didn't misspell it or that the label is available when " + "you run this statement in your application (the missing label name is: " + "THIS_IS_NOT_A_LABEL)", SeverityLevel.WARNING, new InputPosition(17, 1, 18)))));
}
Also used : InputPosition(org.neo4j.graphdb.InputPosition) TestNotification(org.neo4j.bolt.testing.TestNotification) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 TestNotification (org.neo4j.bolt.testing.TestNotification)1 InputPosition (org.neo4j.graphdb.InputPosition)1