InMemoryPermissionsImpl implements PermissionsInterface { @Override public List<Permission> getPermissionsForWorkflow(User user, Workflow workflow) { final List<Permission> permissions = getWorkflowPermissions(workflow); if (isOwner(user, permissions)) { return permissions; } throw new CustomWebApplicationException("Forbidden", HttpStatus.SC_FORBIDDEN); }  @Override List<Permission> setPermission(User requester, Workflow workflow, Permission permission); @Override Map<Role, List<String>> workflowsSharedWithUser(User user); @Override List<Permission> getPermissionsForWorkflow(User user, Workflow workflow); @Override List<Role.Action> getActionsForWorkflow(User user, Workflow workflow); @Override void removePermission(User user, Workflow workflow, String email, Role role); @Override boolean canDoAction(User user, Workflow workflow, Role.Action action); @Override void selfDestruct(User user); @Override boolean isSharing(User user);  }
@Test public void testNoPermissions() { thrown.expect(CustomWebApplicationException.class); inMemoryPermissions.getPermissionsForWorkflow(janeDoeUser, fooWorkflow); }