Skip to content

Include NotificationConfig on BEGIN message for bolt scheme #1404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2023
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
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver-parent</artifactId>
<version>5.8-SNAPSHOT</version>
<version>5.7-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver-parent</artifactId>
<version>5.8-SNAPSHOT</version>
<version>5.7-SNAPSHOT</version>
</parent>

<artifactId>neo4j-java-driver</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ public static Map<String, Value> buildMetadata(
boolean databaseNamePresent = databaseName.databaseName().isPresent();
boolean impersonatedUserPresent = impersonatedUser != null;
boolean txTypePresent = txType != null;
boolean notificationConfigPresent = notificationConfig != null;

if (!bookmarksPresent
&& !txTimeoutPresent
&& !txMetadataPresent
&& !accessModePresent
&& !databaseNamePresent
&& !impersonatedUserPresent
&& !txTypePresent) {
&& !txTypePresent
&& !notificationConfigPresent) {
return emptyMap();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
import org.junit.jupiter.params.provider.ValueSource;
import org.neo4j.driver.AccessMode;
import org.neo4j.driver.Bookmark;
import org.neo4j.driver.NotificationCategory;
import org.neo4j.driver.NotificationConfig;
import org.neo4j.driver.NotificationSeverity;
import org.neo4j.driver.Value;
import org.neo4j.driver.internal.InternalBookmark;

Expand Down Expand Up @@ -106,4 +109,24 @@ void shouldNotHaveMetadataForDatabaseNameWhenIsNull() {
buildMetadata(null, null, defaultDatabase(), WRITE, Collections.emptySet(), null, null, null);
assertTrue(metadata.isEmpty());
}

@Test
void shouldIncludeNotificationConfig() {
var metadata = buildMetadata(
null,
null,
defaultDatabase(),
WRITE,
Collections.emptySet(),
null,
null,
NotificationConfig.defaultConfig()
.enableMinimumSeverity(NotificationSeverity.WARNING)
.disableCategories(Set.of(NotificationCategory.UNSUPPORTED)));

var expectedMetadata = new HashMap<String, Value>();
expectedMetadata.put("notifications_minimum_severity", value("WARNING"));
expectedMetadata.put("notifications_disabled_categories", value(Set.of("UNSUPPORTED")));
assertEquals(expectedMetadata, metadata);
}
}
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver-parent</artifactId>
<version>5.8-SNAPSHOT</version>
<version>5.7-SNAPSHOT</version>
</parent>

<groupId>org.neo4j.doc.driver</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver-parent</artifactId>
<version>5.8-SNAPSHOT</version>
<version>5.7-SNAPSHOT</version>

<packaging>pom</packaging>
<name>Neo4j Java Driver Project</name>
Expand Down
2 changes: 1 addition & 1 deletion testkit-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>neo4j-java-driver-parent</artifactId>
<groupId>org.neo4j.driver</groupId>
<version>5.8-SNAPSHOT</version>
<version>5.7-SNAPSHOT</version>
</parent>

<artifactId>testkit-backend</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion testkit-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver-parent</artifactId>
<version>5.8-SNAPSHOT</version>
<version>5.7-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down