class GroupsResource {

  @Path("{groupId}")
  @Timed @ExceptionMetered
  @DELETE
  public Response deleteGroup(@Auth User user, @PathParam("groupId") LongParam groupId) {
    logger.info("User '{}' deleting group id={}.", user, groupId);

    Optional<Group> group = groupDAO.getGroupById(groupId.get());
    if (!group.isPresent()) {
      throw new NotFoundException("Group not found.");
    }

    groupDAO.deleteGroup(group.get());
    auditLog.recordEvent(new Event(Instant.now(), EventTag.GROUP_DELETE, user.getName(), group.get().getName()));
    return Response.noContent().build();
  }

  @Inject public  GroupsResource(AclDAOFactory aclDAOFactory, GroupDAOFactory groupDAOFactory, AuditLog auditLog);
  @VisibleForTesting  GroupsResource(AclDAO aclDAO, GroupDAO groupDAO, AuditLog auditLog);

}