I have a user watching a repository. I wrote a plugin to unwatch any users this repository. The unwatch request returns a false. Not sure if the new UnwatchRequest.Builder(repository) method call is causing a problem because it is suppose to have a Watchable argument which I assume to be repository:
// impersonate user watching repository
securityService.impersonating(userService.getUserBySlug(slug), "deleteWatchers").applyToRequest();
unwatchRequestBuilder = new UnwatchRequest.Builder(repository);
unwatchRequest = unwatchRequestBuilder.build();
if (watcherService.unwatch(unwatchRequest))
{
logger.debug("Unwatching repository for user: " + slug + " successful");
}
else
{
logger.debug("Unwatching repository for user: " + slug + " failed");
}