@Test(description = "This method tests the getGroups with device id and device type under different conditions")
public void testGetGroupsWithDeviceId() throws GroupManagementException {

    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getGroupManagementProviderService"))
            .toReturn(groupManagementProviderService);
    DeviceIdentifier deviceIdentifier = new DeviceIdentifier("test", "android");
    Mockito.doReturn(new ArrayList<DeviceGroup>()).when(groupManagementProviderService).getGroups(deviceIdentifier);
    Response response = groupManagementService.getGroups("test", "android");
    Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(),
            "getGroups request failed with valid parameters");
    Mockito.reset(groupManagementProviderService);
    Mockito.doThrow(new GroupManagementException()).when(groupManagementProviderService)
            .getGroups(Mockito.any(DeviceIdentifier.class));
    response = groupManagementService.getGroups("test", "android2");
    Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),
            "getGroups request succeeded with in-valid parameters");
}