@Test(description = "This method tests the functionality of manageGroupSharing under various conditions")
public void testManageGroupSharing() throws GroupManagementException, RoleDoesNotExistException {

    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getGroupManagementProviderService"))
            .toReturn(groupManagementProviderService);
    Mockito.doNothing().when(groupManagementProviderService).manageGroupSharing(1, null);
    Mockito.doThrow(new GroupManagementException("test")).when(groupManagementProviderService)
            .manageGroupSharing(2, null);
    Mockito.doThrow(new RoleDoesNotExistException()).when(groupManagementProviderService)
            .manageGroupSharing(3, null);
    Response response = groupManagementService.manageGroupSharing(1, null);
    Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(),
            "managegroupSharing request failed for a request with valid parameters");
    response = groupManagementService.manageGroupSharing(2, null);
    Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),
            "managegroupSharing request succeeded for a request with in-valid parameters");
    response = groupManagementService.manageGroupSharing(3, null);
    Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode(),
            "managegroupSharing request succeeded for a request with in-valid parameters");
}