       (test-util/delete-group token concept_id)
       (is (= {:status 404
               :errors [(format "Group with concept id [%s] was deleted." concept_id)]}
-             (test-util/update-group token concept_id group))))))
+             (test-util/update-group token concept_id group))))
+
+    (testing "Update a group with conflicting name"
+      (test-util/wait-until-indexed)
+      (is (= {:status 409
+              :errors [(format "A system group with name [%s] already exists with concept id [%s]."
+                               (:name group)
+                               concept_id)]}
+             (test-util/update-group token concept_id2 (assoc group2 :name (:name group))))))))
 
 (deftest update-group-legacy-guid-test
   (let [group1 (test-util/make-group {:legacy_guid "legacy_guid_1" :name "group1"})


(deftest update-group-failure-test
  (let [group (test-util/make-group)
        token (echo-util/login (test-util/conn-context) "user1")
        {:keys [concept_id revision_id]} (test-util/create-group token group)]

    (testing "Update group with invalid content type"
      (is (= {:status 400,

      (is (empty? (set (:items (test-util/search-for-acls token {:permitted_group group-1-concept-id}))))))))

(deftest update-group-test
  (let [group (test-util/make-group {:members ["user1" "user2"]})
        token (echo-util/login (test-util/conn-context) "user1")
        {:keys [concept_id]} (test-util/create-group token group)]

    ;; Do not specify members in the update
    (let [updated-group {:name "Updated Group Name"
                         :description "Updated group description"}
          token2 (echo-util/login (test-util/conn-context) "user2")
          response (test-util/update-group token2 concept_id updated-group)]
      (is (= {:status 200 :concept_id concept_id :revision_id 2}
             response))
      ;; Members should be intact
      (test-util/assert-group-saved (assoc updated-group :members ["user1" "user2"]) "user2" concept_id 2))))

(deftest update-group-with-members-test
  (let [group (test-util/make-group {:members ["user1" "user2"]})
