@Test
public void shouldDeleteDomainLevelAffinityGroup() {

    AffinityGroupVO mockGroup = Mockito.mock(AffinityGroupVO.class);
    when(mockGroup.getId()).thenReturn(2L);
    when(_affinityGroupDao.findById(Matchers.anyLong())).thenReturn(mockGroup);
    _affinityService.deleteAffinityGroup(2L, null, null, DOMAIN_ID, null);
    Mockito.verify(_affinityGroupDao).expunge(2L);
}