From a8537e4d0f8597e111b44a62e33ed676a0b9067b Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Tue, 28 Nov 2023 18:34:46 +0000 Subject: [PATCH] test: create create database scenario Signed-off-by: Otavio Santana --- .../java/expert/os/harperdb/ServerTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/src/test/java/expert/os/harperdb/ServerTest.java b/core/src/test/java/expert/os/harperdb/ServerTest.java index 80448cc..e405fad 100644 --- a/core/src/test/java/expert/os/harperdb/ServerTest.java +++ b/core/src/test/java/expert/os/harperdb/ServerTest.java @@ -41,6 +41,23 @@ void shouldReturnNPEWhenSchemaIsNull() { Assertions.assertThrows(NullPointerException.class, () -> server.createTable("schema").table("table").id(null)); } + @Test + void shouldReturnNPEWhenCreateDatabaseIsNull() { + Server server = getServer(); + + Assertions.assertThrows(NullPointerException.class, () -> server.createDatabase(null)); + } + + @Test + void shouldCreateDatabase() { + Server server = getServer(); + + SoftAssertions.assertSoftly(softly -> { + softly.assertThat(server.createDatabase("database")).isTrue(); + softly.assertThat(server.createDatabase("database")).isFalse(); + }); + } + @Test void shouldCreateTable() { Server server = getServer();