@SuppressWarnings("unchecked")
@Test
public void testRefreshGroups() throws PAPException {

    PolicyController mockPolicyController = Mockito.mock(PolicyController.class);
    PAPPolicyEngine mockPAPPolicyEngine = Mockito.mock(PAPPolicyEngine.class);
    when(mockPolicyController.getPapEngine()).thenReturn(mockPAPPolicyEngine);
    when(mockPAPPolicyEngine.getOnapPDPGroups()).thenThrow(PAPException.class);
    apController.setPolicyController(mockPolicyController);
    apController.refreshGroups();
    verify(mockPolicyController).getPapEngine();
    verify(mockPAPPolicyEngine).getOnapPDPGroups();
}