From 79024b050421fc9ddbc2e902803afddf5abdbe9d Mon Sep 17 00:00:00 2001 From: Sona Markosyan Date: Fri, 11 Feb 2022 02:07:32 +0100 Subject: [PATCH] Should Not Create Account when Password is blank or null --- .../hs/fulda/de/ci/exam/project/AccountServiceTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/hs/fulda/de/ci/exam/project/AccountServiceTest.java b/src/test/java/hs/fulda/de/ci/exam/project/AccountServiceTest.java index 326576a..f9cd7b5 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/AccountServiceTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/AccountServiceTest.java @@ -107,4 +107,12 @@ public class AccountServiceTest { }); } + @Test + @DisplayName("Should Not Create Account when password is blank") + public void shouldThrowRuntimeExceptionWhenPasswordIsNull(){ + assertThrows(RuntimeException.class, () -> { + accountService.createAccount("John", "", Account.AccountStatus.ACTIVE); + }); + } + }