@Test(description = "This method tests the addDevicesToGroup method under various conditions.")
public void testAddDevicesToGroup() throws GroupManagementException, DeviceNotFoundException {

    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getGroupManagementProviderService"))
            .toReturn(groupManagementProviderService);
    List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
    Mockito.doNothing().when(groupManagementProviderService).addDevices(1, deviceIdentifiers);
    Mockito.doThrow(new GroupManagementException()).when(groupManagementProviderService).addDevices(2,
            deviceIdentifiers);
    Mockito.doThrow(new DeviceNotFoundException()).when(groupManagementProviderService).addDevices(3,
            deviceIdentifiers);
    Response response = groupManagementService.addDevicesToGroup(1, deviceIdentifiers);
    Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(),
            "addDevicesToGroup request failed for a request with valid parameters");
    response = groupManagementService.addDevicesToGroup(2, deviceIdentifiers);
    Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),
            "addDevicesToGroup request succeded for a request with in-valid parameters");
    response = groupManagementService.addDevicesToGroup(3, deviceIdentifiers);
    Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode(),
            "addDevicesToGroup request succeded for a request with in-valid parameters");
}