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 b1c1681..90d1d69 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 @@ -59,6 +59,15 @@ public class AccountServiceTest { inOrder.verify(passwordEncoder, never()).encode(anyString()); } + @Test + public void shouldBeInvalidForDisabledUser(){ + boolean accountIsValid = + accountService.isValidAccount(DISABLED_USER.getId(), PASSWORD); + assertFalse(accountIsValid); + + verify(accountRepository).findById(DISABLED_USER.getId()); + verify(passwordEncoder, never()).encode(anyString()); + } private AccountRepository createAccountRepository() { AccountRepository mock = mock(AccountRepository.class); when(mock.findById(ENABLED_USER.getId())).thenReturn(ENABLED_USER);