Skip to content

Commit

Permalink
test: create null validation
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Nov 28, 2023
1 parent 9dabba0 commit 03e7b07
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/src/test/java/expert/os/harperdb/ServerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ void shouldNotCreateSchemaDuplicated() {
Assertions.assertFalse(server.schema("duplicated"));
}

@Test
void shouldReturnNPEWhenSchemaIsNull() {
Server server = getServer();

Assertions.assertThrows(NullPointerException.class, () -> server.table(null));
Assertions.assertThrows(NullPointerException.class, () -> server.table("schema").table(null));
Assertions.assertThrows(NullPointerException.class, () -> server.table("schema").table("table").id(null));
}

private Server getServer() {
return ServerBuilder.of(container.host())
.withCredentials(container.user(), container.password());
Expand Down

0 comments on commit 03e7b07

Please sign in to comment.