Skip to content

Commit af95cda

Browse files
committed
tests: add test for processing null arrays
1 parent 2fa4360 commit af95cda

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/src/test/java/io/github/tandemdude/sgj/postgres/TestQueries.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ public void createMessageProcessesInputListCorrectly() throws Exception {
112112
}
113113
}
114114

115+
@Test
116+
@DisplayName("GetMessage works when attachments is null")
117+
public void getMessageWorksWhenAttachmentsIsNull() throws Exception {
118+
try (var conn = getConn()) {
119+
var q = new Queries(conn);
120+
121+
var created = q.createMessage(1, UUID.randomUUID(), "foo", null);
122+
assertThat(created).isPresent();
123+
124+
var found = q.getMessage(created.get());
125+
assertThat(found).isPresent();
126+
assertThat(found.get().attachments()).isNull();
127+
}
128+
}
129+
115130
@Test
116131
@DisplayName("GetUserAndToken returns embedded objects")
117132
public void getUserAndTokenReturnsEmbeddedObjects() throws Exception {

0 commit comments

Comments
 (0)