@Test(description = "This method tests the getDeviceCountOfGroup function under various different conditions.")
public void testGetDeviceCountOfGroup() throws GroupManagementException {

    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getGroupManagementProviderService"))
            .toReturn(groupManagementProviderService);
    Mockito.doReturn(1).when(groupManagementProviderService).getDeviceCount(1);
    Mockito.doThrow(new GroupManagementException()).when(groupManagementProviderService).getDeviceCount(2);
    Response response = groupManagementService.getDeviceCountOfGroup(1);
    Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(),
            "getDeviceCountOfGroup request failed for a request with valid parameters");
    response = groupManagementService.getDeviceCountOfGroup(2);
    Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),
            "getDeviceCountOfGroup request succeded for a request with in-valid parameters");
}