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)))));
}
Aggregations