Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit 5b8a824

Browse files
committed
Fix non-null build failures (new IntelliJ setting)
1 parent 4d26858 commit 5b8a824

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

cypher-shell/src/main/java/org/neo4j/shell/state/BoltResult.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ public BoltResult(@Nonnull List<Record> records, @Nonnull ResultSummary summary)
1919
this.summary = summary;
2020
}
2121

22+
@Nonnull
2223
public List<Record> getRecords() {
2324
return records;
2425
}
2526

27+
@Nonnull
2628
public ResultSummary getSummary() {
2729
return summary;
2830
}

cypher-shell/src/test/java/org/neo4j/shell/CypherShellTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public class CypherShellTest {
4646

4747
@Before
4848
public void setup() {
49+
when(mockedBoltStateHandler.getServerVersion()).thenReturn("");
50+
4951
doReturn(System.out).when(logger).getOutputStream();
5052
offlineTestShell = new OfflineTestShell(logger, mockedBoltStateHandler, mockedPrettyPrinter);
5153

cypher-shell/src/test/java/org/neo4j/shell/prettyprint/PrettyPrinterTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public void prettyPrintList() throws Exception {
7171
when(record2.values()).thenReturn(asList(value2));
7272

7373
when(result.getRecords()).thenReturn(asList(record1, record2));
74+
when(result.getSummary()).thenReturn(mock(ResultSummary.class));
7475

7576
// when
7677
String actual = plainPrinter.format(result);
@@ -102,6 +103,7 @@ public void prettyPrintNode() throws Exception {
102103
when(record.values()).thenReturn(asList(value));
103104

104105
when(result.getRecords()).thenReturn(asList(record));
106+
when(result.getSummary()).thenReturn(mock(ResultSummary.class));
105107

106108
// when
107109
String actual = plainPrinter.format(result);
@@ -134,6 +136,7 @@ public void prettyPrintRelationships() throws Exception {
134136
when(record.values()).thenReturn(asList(value));
135137

136138
when(result.getRecords()).thenReturn(asList(record));
139+
when(result.getSummary()).thenReturn(mock(ResultSummary.class));
137140

138141
// when
139142
String actual = plainPrinter.format(result);
@@ -179,6 +182,7 @@ public void printRelationshipsAndNodesWithEscapingForSpecialCharacters() throws
179182
when(record.values()).thenReturn(asList(relVal, nodeVal));
180183

181184
when(result.getRecords()).thenReturn(asList(record));
185+
when(result.getSummary()).thenReturn(mock(ResultSummary.class));
182186

183187
// when
184188
String actual = plainPrinter.format(result);
@@ -240,6 +244,7 @@ public void prettyPrintPaths() throws Exception {
240244
when(record.values()).thenReturn(asList(value));
241245

242246
when(result.getRecords()).thenReturn(asList(record));
247+
when(result.getSummary()).thenReturn(mock(ResultSummary.class));
243248

244249
// when
245250
String actual = plainPrinter.format(result);
@@ -287,6 +292,7 @@ public void prettyPrintSingleNodePath() throws Exception {
287292
when(record.values()).thenReturn(asList(value));
288293

289294
when(result.getRecords()).thenReturn(asList(record));
295+
when(result.getSummary()).thenReturn(mock(ResultSummary.class));
290296

291297
// when
292298
String actual = plainPrinter.format(result);
@@ -350,6 +356,7 @@ public void prettyPrintThreeSegmentPath() throws Exception {
350356
when(record.values()).thenReturn(asList(value));
351357

352358
when(result.getRecords()).thenReturn(asList(record));
359+
when(result.getSummary()).thenReturn(mock(ResultSummary.class));
353360

354361
// when
355362
String actual = plainPrinter.format(result);

0 commit comments

Comments
 (0)