Skip to content

Commit 7d0d2a6

Browse files
committed
Enable compilation failures on warnings for tests
1 parent 52ec6ea commit 7d0d2a6

File tree

70 files changed

+221
-276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+221
-276
lines changed

driver/src/test/java/org/neo4j/driver/SessionConfigTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ void shouldTwoConfigBeEqual() {
174174
}
175175

176176
@Test
177+
@SuppressWarnings("deprecation")
177178
void shouldSerialize() throws Exception {
178179
SessionConfig config = SessionConfig.builder()
179180
.withBookmarks(

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

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import static org.neo4j.driver.internal.util.BookmarkUtil.assertBookmarkIsEmpty;
2929
import static org.neo4j.driver.internal.util.BookmarkUtil.assertBookmarksContainsSingleUniqueValues;
3030

31-
import java.util.UUID;
3231
import org.junit.jupiter.api.BeforeEach;
3332
import org.junit.jupiter.api.Test;
3433
import org.junit.jupiter.api.extension.RegisterExtension;
@@ -59,6 +58,7 @@ void assumeBookmarkSupport() {
5958

6059
@Test
6160
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V4)
61+
@SuppressWarnings("deprecation")
6262
void shouldReceiveBookmarkOnSuccessfulCommit() throws Throwable {
6363
// Given
6464
assertBookmarkIsEmpty(session.lastBookmark());
@@ -72,6 +72,7 @@ void shouldReceiveBookmarkOnSuccessfulCommit() throws Throwable {
7272

7373
@Test
7474
@EnabledOnNeo4jWith(Neo4jFeature.BOLT_V4)
75+
@SuppressWarnings("deprecation")
7576
void shouldReceiveNewBookmarkOnSuccessfulCommit() throws Throwable {
7677
// Given
7778
Bookmark initialBookmark = session.lastBookmark();
@@ -96,6 +97,7 @@ void shouldThrowForInvalidBookmark() {
9697
}
9798

9899
@Test
100+
@SuppressWarnings("deprecation")
99101
void bookmarkRemainsAfterRolledBackTx() {
100102
assertBookmarkIsEmpty(session.lastBookmark());
101103

@@ -113,6 +115,7 @@ void bookmarkRemainsAfterRolledBackTx() {
113115
}
114116

115117
@Test
118+
@SuppressWarnings("deprecation")
116119
void bookmarkRemainsAfterTxFailure() {
117120
assertBookmarkIsEmpty(session.lastBookmark());
118121

@@ -128,6 +131,7 @@ void bookmarkRemainsAfterTxFailure() {
128131
}
129132

130133
@Test
134+
@SuppressWarnings("deprecation")
131135
void bookmarkRemainsAfterSuccessfulSessionRun() {
132136
assertBookmarkIsEmpty(session.lastBookmark());
133137

@@ -142,6 +146,7 @@ void bookmarkRemainsAfterSuccessfulSessionRun() {
142146
}
143147

144148
@Test
149+
@SuppressWarnings("deprecation")
145150
void bookmarkRemainsAfterFailedSessionRun() {
146151
assertBookmarkIsEmpty(session.lastBookmark());
147152

@@ -155,6 +160,7 @@ void bookmarkRemainsAfterFailedSessionRun() {
155160
}
156161

157162
@Test
163+
@SuppressWarnings("deprecation")
158164
void bookmarkIsUpdatedOnEveryCommittedTx() {
159165
assertBookmarkIsEmpty(session.lastBookmark());
160166

@@ -174,6 +180,7 @@ void bookmarkIsUpdatedOnEveryCommittedTx() {
174180
}
175181

176182
@Test
183+
@SuppressWarnings("deprecation")
177184
void createSessionWithInitialBookmark() {
178185
Bookmark bookmark = parse("TheBookmark");
179186
try (Session session = driver.session(builder().withBookmarks(bookmark).build())) {
@@ -182,6 +189,7 @@ void createSessionWithInitialBookmark() {
182189
}
183190

184191
@Test
192+
@SuppressWarnings("deprecation")
185193
void createSessionWithAccessModeAndInitialBookmark() {
186194
Bookmark bookmark = parse("TheBookmark");
187195
try (Session session = driver.session(builder().withBookmarks(bookmark).build())) {
@@ -195,22 +203,4 @@ private static void createNodeInTx(Session session) {
195203
tx.commit();
196204
}
197205
}
198-
199-
private static boolean isUuid(String string) {
200-
try {
201-
UUID.fromString(string);
202-
} catch (IllegalArgumentException | NullPointerException e) {
203-
return false;
204-
}
205-
return true;
206-
}
207-
208-
private static boolean isNumeric(String string) {
209-
try {
210-
Long.parseLong(string);
211-
} catch (NumberFormatException | NullPointerException e) {
212-
return false;
213-
}
214-
return true;
215-
}
216206
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ void connectionUsedForBeginTxReturnedToThePoolWhenSessionClose() {
300300

301301
@Test
302302
@EnabledOnNeo4jWith(BOLT_V4)
303+
@SuppressWarnings("deprecation")
303304
void sessionCloseShouldReleaseConnectionUsedBySessionRun() {
304305
RxSession session = driver.rxSession();
305306
RxResult res = session.run("UNWIND [1,2,3,4] AS a RETURN a");
@@ -320,6 +321,7 @@ void sessionCloseShouldReleaseConnectionUsedBySessionRun() {
320321

321322
@Test
322323
@EnabledOnNeo4jWith(BOLT_V4)
324+
@SuppressWarnings("deprecation")
323325
void resultRecordsShouldReleaseConnectionUsedBySessionRun() {
324326
RxSession session = driver.rxSession();
325327
RxResult res = session.run("UNWIND [1,2,3,4] AS a RETURN a");
@@ -339,6 +341,7 @@ void resultRecordsShouldReleaseConnectionUsedBySessionRun() {
339341

340342
@Test
341343
@EnabledOnNeo4jWith(BOLT_V4)
344+
@SuppressWarnings("deprecation")
342345
void resultSummaryShouldReleaseConnectionUsedBySessionRun() {
343346
RxSession session = driver.rxSession();
344347
RxResult res = session.run("UNWIND [1,2,3,4] AS a RETURN a");
@@ -354,6 +357,7 @@ void resultSummaryShouldReleaseConnectionUsedBySessionRun() {
354357

355358
@Test
356359
@EnabledOnNeo4jWith(BOLT_V4)
360+
@SuppressWarnings("deprecation")
357361
void txCommitShouldReleaseConnectionUsedByBeginTx() {
358362
AtomicReference<Connection> connection1Ref = new AtomicReference<>();
359363

@@ -386,6 +390,7 @@ void txCommitShouldReleaseConnectionUsedByBeginTx() {
386390

387391
@Test
388392
@EnabledOnNeo4jWith(BOLT_V4)
393+
@SuppressWarnings("deprecation")
389394
void txRollbackShouldReleaseConnectionUsedByBeginTx() {
390395
AtomicReference<Connection> connection1Ref = new AtomicReference<>();
391396

@@ -418,6 +423,7 @@ void txRollbackShouldReleaseConnectionUsedByBeginTx() {
418423

419424
@Test
420425
@EnabledOnNeo4jWith(BOLT_V4)
426+
@SuppressWarnings("deprecation")
421427
void sessionCloseShouldReleaseConnectionUsedByBeginTx() {
422428
// Given
423429
RxSession session = driver.rxSession();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class EntityTypeIT {
3636
static final SessionExtension session = new SessionExtension();
3737

3838
@Test
39+
@SuppressWarnings("deprecation")
3940
void shouldReturnIdentitiesOfNodes() {
4041
// When
4142
Result cursor = session.run("CREATE (n) RETURN n");
@@ -46,6 +47,7 @@ void shouldReturnIdentitiesOfNodes() {
4647
}
4748

4849
@Test
50+
@SuppressWarnings("deprecation")
4951
void shouldReturnIdentitiesOfRelationships() {
5052
// When
5153
Result cursor = session.run("CREATE ()-[r:T]->() RETURN r");
@@ -58,6 +60,7 @@ void shouldReturnIdentitiesOfRelationships() {
5860
}
5961

6062
@Test
63+
@SuppressWarnings("deprecation")
6164
void shouldReturnIdentitiesOfPaths() {
6265
// When
6366
Result cursor = session.run("CREATE p=()-[r:T]->() RETURN p");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ void shouldFailForIllegalQueries() {
169169
}
170170

171171
@Test
172+
@SuppressWarnings("deprecation")
172173
void shouldBeAbleToLogSemanticWrongExceptions() {
173174
try {
174175
// When I run a query with the old syntax

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ void shouldSetTransactionMetadataWithWriteTransactionFunction() {
189189
}
190190

191191
@Test
192+
@SuppressWarnings("deprecation")
192193
void shouldUseBookmarksForAutoCommitTransactions() {
193194
Session session = driver.session();
194195
Bookmark initialBookmark = session.lastBookmark();
@@ -213,6 +214,7 @@ void shouldUseBookmarksForAutoCommitTransactions() {
213214
}
214215

215216
@Test
217+
@SuppressWarnings("deprecation")
216218
void shouldUseBookmarksForAutoCommitAndUnmanagedTransactions() {
217219
Session session = driver.session();
218220
Bookmark initialBookmark = session.lastBookmark();
@@ -243,6 +245,7 @@ void shouldUseBookmarksForAutoCommitAndUnmanagedTransactions() {
243245
}
244246

245247
@Test
248+
@SuppressWarnings("deprecation")
246249
void shouldUseBookmarksForAutoCommitTransactionsAndTransactionFunctions() {
247250
Session session = driver.session();
248251
Bookmark initialBookmark = session.lastBookmark();
@@ -307,6 +310,7 @@ void shouldSendGoodbyeWhenClosingDriver() {
307310
}
308311
}
309312

313+
@SuppressWarnings("deprecation")
310314
private static void testTransactionMetadataWithAsyncTransactionFunctions(boolean read) {
311315
AsyncSession asyncSession = driver.asyncSession();
312316
Map<String, Object> metadata = new HashMap<>();
@@ -329,6 +333,7 @@ private static void testTransactionMetadataWithAsyncTransactionFunctions(boolean
329333
assertEquals(metadata, await(metadataFuture));
330334
}
331335

336+
@SuppressWarnings("deprecation")
332337
private static void testTransactionMetadataWithTransactionFunctions(boolean read) {
333338
Session session = driver.session();
334339
Map<String, Object> metadata = new HashMap<>();

0 commit comments

Comments
 (0)