Skip to content

Commit aae010c

Browse files
authored
feat(notification): delete deprecated Notification#severity() (#1651)
BREAKING CHANGE: the deprecated `org.neo4j.driver.summary.Notification#severity()` has been deleted, please use either `org.neo4j.driver.summary.Notification#severityLevel()` or `org.neo4j.driver.summary.Notification#rawSeverityLevel()`.
1 parent c5c9d0f commit aae010c

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

driver/clirr-ignored-differences.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,4 +806,10 @@
806806
<method>java.io.File certFile()</method>
807807
</difference>
808808

809+
<difference>
810+
<className>org/neo4j/driver/summary/Notification</className>
811+
<differenceType>7002</differenceType>
812+
<method>java.lang.String severity()</method>
813+
</difference>
814+
809815
</differences>

driver/src/main/java/org/neo4j/driver/summary/Notification.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ default Optional<InputPosition> inputPosition() {
7272
return Optional.ofNullable(position());
7373
}
7474

75-
/**
76-
* The severity level of the notification.
77-
*
78-
* @deprecated superseded by {@link #severityLevel()} and {@link #rawSeverityLevel()}
79-
* @return the severity level of the notification
80-
*/
81-
@Deprecated
82-
default String severity() {
83-
return rawSeverityLevel().orElse("N/A");
84-
}
85-
8675
/**
8776
* Returns the severity level of the notification derived from the diagnostic record.
8877
*

driver/src/test/java/org/neo4j/driver/integration/SummaryIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ void shouldContainProfile() {
229229
}
230230

231231
@Test
232-
@SuppressWarnings("deprecation")
233232
void shouldContainNotifications() {
234233
// When
235234
var summary =
@@ -243,7 +242,6 @@ void shouldContainNotifications() {
243242
assertThat(notification.code(), notNullValue());
244243
assertThat(notification.title(), notNullValue());
245244
assertThat(notification.description(), notNullValue());
246-
assertThat(notification.severity(), notNullValue());
247245
assertThat(notification.severityLevel(), notNullValue());
248246
assertThat(notification.rawSeverityLevel(), notNullValue());
249247
assertThat(notification.position(), notNullValue());

driver/src/test/java/org/neo4j/driver/internal/util/MetadataExtractorTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ void shouldBuildResultSummaryWithNotifications() {
250250
assertEquals("Almost bad thing", firstNotification.description());
251251
assertEquals("Neo.DummyNotification", firstNotification.code());
252252
assertEquals("A title", firstNotification.title());
253-
assertEquals("WARNING", firstNotification.severity());
254253
assertEquals(
255254
NotificationSeverity.WARNING, firstNotification.severityLevel().get());
256255
assertEquals("WARNING", firstNotification.rawSeverityLevel().get());
@@ -280,7 +279,8 @@ void shouldBuildResultSummaryWithNotifications() {
280279
assertEquals("Almost good thing", secondNotification.description());
281280
assertEquals("Neo.GoodNotification", secondNotification.code());
282281
assertEquals("Good", secondNotification.title());
283-
assertEquals("INFO", secondNotification.severity());
282+
assertFalse(secondNotification.severityLevel().isPresent());
283+
assertEquals("INFO", secondNotification.rawSeverityLevel().get());
284284
assertTrue(secondNotification.inputPosition().isEmpty());
285285
assertNull(secondNotification.position());
286286
assertEquals(
@@ -348,7 +348,6 @@ void shouldBuildResultSummaryWithGqlStatusObjects() {
348348
assertEquals("notification_description", firstGqlStatusObject.description());
349349
assertEquals("neo4j_code", firstGqlStatusObject.code());
350350
assertEquals("title", firstGqlStatusObject.title());
351-
assertEquals("WARNING", firstGqlStatusObject.severity());
352351
assertEquals(
353352
NotificationSeverity.WARNING,
354353
firstGqlStatusObject.severityLevel().get());

testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/SummaryUtil.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public static Summary.SummaryBody toSummaryBody(org.neo4j.driver.summary.ResultS
6666
.title(s.title())
6767
.description(s.description())
6868
.position(toInputPosition(s.position()))
69-
.severity(s.severity())
7069
.severityLevel(s.severityLevel()
7170
.map(InternalNotificationSeverity.class::cast)
7271
.map(InternalNotificationSeverity::type)

testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/Summary.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ public static class Notification {
121121

122122
private InputPosition position;
123123

124-
private String severity;
125-
126124
private String severityLevel;
127125

128126
private String rawSeverityLevel;

0 commit comments

Comments
 (0)