コード例 #1
0
ファイル: AdminUserServiceTest.java プロジェクト: hufon/ginco
  @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);
  }
コード例 #2
0
 @Override
 public ExternalThesaurusType getExternalThesaurusTypeById(Integer identifier) {
   return externalThesaurusTypeDAO.getById(identifier);
 }
コード例 #3
0
 @Override
 public List<ExternalThesaurusType> getExternalThesaurusTypeList() {
   return externalThesaurusTypeDAO.findAll();
 }