コード例 #1
0
 @Test
 public void getPrimaryGroupKeylessWithUnknownIDReturnsBlank()
     throws MalformedURLException, InstantiationException, IllegalAccessException, SQLException {
   configuration.webappPrimaryGroupUsesKey = false;
   when(sql.sqlQuery(anyString())).thenReturn(result);
   assertEquals("", webGroupDao.getPrimaryGroupID(user_id1));
 }
コード例 #2
0
 @Test
 public void getPrimaryGroupKeyedWithValidIDReturnsGroup()
     throws MalformedURLException, InstantiationException, IllegalAccessException, SQLException {
   when(sql.sqlQuery(anyString())).thenReturn(result);
   when(result.next()).thenReturn(Boolean.TRUE);
   when(result.getString(configuration.webappPrimaryGroupGroupIDColumn)).thenReturn(group1);
   assertEquals(group1, webGroupDao.getPrimaryGroupID(user_id1));
 }
コード例 #3
0
 @Test
 public void getPrimaryGroupWithPrimaryDisabledReturnsBlank()
     throws IllegalAccessException, InstantiationException, MalformedURLException, SQLException {
   configuration.webappPrimaryGroupEnabled = false;
   assertEquals("", webGroupDao.getPrimaryGroupID(user_id1));
 }
コード例 #4
0
 @Test
 public void getPrimaryGroupNeverReturnsNull()
     throws IllegalAccessException, SQLException, MalformedURLException, InstantiationException {
   configuration.webappPrimaryGroupEnabled = false;
   assertNotNull(webGroupDao.getPrimaryGroupID(""));
 }