@Test(description = "This method tests the getDevicesOfGroup under various conditions")
public void testGetDevicesOfGroup() throws GroupManagementException {

    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getGroupManagementProviderService"))
            .toReturn(groupManagementProviderService);
    Mockito.doReturn(1).when(groupManagementProviderService).getDeviceCount(Mockito.anyInt());
    Mockito.doReturn(new ArrayList<Device>()).when(groupManagementProviderService).getDevices(1, 0, 10);
    Mockito.doReturn(null).when(groupManagementProviderService).getDevices(2, 0, 10);
    Mockito.doThrow(new GroupManagementException()).when(groupManagementProviderService).getDevices(3, 0, 10);
    Response response = groupManagementService.getDevicesOfGroup(1, 0, 10);
    Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(),
            "getDevicesOfGroup request failed for a request with valid parameters");
    response = groupManagementService.getDevicesOfGroup(2, 0, 10);
    Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(),
            "getDevicesOfGroup request failed for a request with valid parameters");
    response = groupManagementService.getDevicesOfGroup(3, 0, 10);
    Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),
            "getDevicesOfGroup request succeded for a request with in-valid parameters");
}