         (dc/psa {:name "bool" :data-type :boolean :value true})]}
       ["AdditionalAttributes"]
       ["Additional Attributes must be unique. This contains duplicates named [bool]."]))
+
   (testing "Nested Path Validation"
     (assert-invalid
       {:platforms [(dc/platform {:instruments [(dc/instrument {:short-name "I1"})
                                                (dc/instrument {:short-name "I1"})]})]}
       ["Platforms" 0 "Instruments"]
       ["Instruments must be unique. This contains duplicates named [I1]."]))
+
   (testing "Spatial validation"
     (testing "geodetic polygon"
       ;; Invalid points are caught in the schema validation

      {:entry-title "ET-1" :concept-id "C1-PROV1" :native-id "Native1"})
    (assert-valid
      {:entry-title "ET-1" :concept-id "C1-PROV2" :native-id "Native1" :provider-id "PROV2"}))
  (testing "entry-title must be unique for a provider"
    (assert-conflict
      {:entry-title "ET-1" :concept-id "C2-PROV1" :native-id "Native2"}
      ["The Entry Title [ET-1] must be unique. The following concepts with the same entry title were found: [C1-PROV1]."])))

(deftest header-validations
  (testing "ingesting a concept with the same concept-id and revision-id fails"
    (let [concept-id "C1-PROV1"
          existing-concept (dc/collection-concept {:revision-id 1 :concept-id concept-id})

                   "Line 1 - cvc-complex-type.2.4.b: The content of element 'Collection' is not complete. One of '{ShortName}' is expected."]]
             [status errors])))))

(deftest successful-validation-with-accept-header-test
  (testing "successful validation requests do not get an xml or json response body"
    (are [accept]
         (let [collection (dc/collection-dif10 {:processing-level-id "Level 1"})
               concept (dc/collection-concept collection :dif10)
               response-map (select-keys (ingest/validate-concept concept {:accept-format accept :raw? true})
                                         [:status :body])]
           (= {:status 200 :body ""} response-map))
         :json :xml)))

(deftest failed-validation-without-headers-returns-xml
  (testing "failed validations with no accept or content-type header return xml"
    (let [concept (assoc (dc/collection-concept {}) :metadata "<Collection>invalid xml</Collection>")
          {:keys [status body]} (ingest/validate-concept concept {:raw? true})]
      (is (= [400 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><errors><error>Line 1 - cvc-complex-type.2.3: Element 'Collection' cannot have character [children], because the type's content type is element-only.</error><error>Line 1 - cvc-complex-type.2.4.b: The content of element 'Collection' is not complete. One of '{ShortName}' is expected.</error></errors>"]
             [status body])))))

(deftest collection-keyword-validation-test
  ;; For a list of the valid keywords during testing see dev-system/resources/kms_examples
  (testing "Keyword validation using validation endpoint"
    (let [concept (dc/collection-concept {:platforms [(dc/platform {:short-name "foo"
                                                                    :long-name "Airbus A340-600"})]})
