@Test public final void testIsUserAdmin() throws BusinessException { String userId1 = "user1.culture.gouv.fr"; String userId2 = "user2.culture.gouv.fr"; AdminUser user1 = new AdminUser(); user1.setUserId(userId1); Mockito.when(adminUserDAO.getById(userId1)).thenReturn(user1); Mockito.when(adminUserDAO.getById(userId2)).thenReturn(null); boolean isUser1Admin = adminUserService.isUserAdmin(userId1); Assert.assertTrue(isUser1Admin); boolean isUser2Admin = adminUserService.isUserAdmin(userId2); Assert.assertFalse(isUser2Admin); }
@Override public ExternalThesaurusType getExternalThesaurusTypeById(Integer identifier) { return externalThesaurusTypeDAO.getById(identifier); }
@Override public List<ExternalThesaurusType> getExternalThesaurusTypeList() { return externalThesaurusTypeDAO.findAll(); }