コード例 #1
0
 @Test
 public void removeGroupUsesCorrectReadQuery()
     throws MalformedURLException, InstantiationException, IllegalAccessException, SQLException {
   String query = getRemoveGroupReadQuery();
   when(sql.sqlQuery(query)).thenReturn(result);
   when(result.next()).thenReturn(false);
   webGroupDao.removeUserFromGroup(USER_ID, GROUP_ID);
   verify(sql).sqlQuery(query);
 }
コード例 #2
0
 private void testRemoveGroupUpdateQuery(String before, String after)
     throws SQLException, IllegalAccessException, MalformedURLException, InstantiationException {
   when(sql.sqlQuery(getRemoveGroupReadQuery())).thenReturn(result);
   when(result.next()).thenReturn(true);
   when(result.getString(configuration.webappSecondaryGroupGroupIDColumn)).thenReturn(before);
   String query = getRemoveGroupUpdateQuery(after);
   doNothing().when(sql).updateQuery(query);
   webGroupDao.removeUserFromGroup(USER_ID, group1);
   verify(sql).updateQuery(query);
 }