File tree Expand file tree Collapse file tree
src/cmr/system_int_test/utils
test/cmr/system_int_test/ingest/subscription Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11(defproject nasa-cmr /cmr-ingest-app " 0.1.0-SNAPSHOT"
22 :description " Ingest is an external facing CMR service facilitating providers to create and update their concepts in CMR. Internally it delegates concept persistence operations to metadata db and indexer micro services."
33 :url " https://github.com/nasa/Common-Metadata-Repository/tree/master/ingest-app"
4- :dependencies [[camel-snake-kebab " 0.4.2 " ]
4+ :dependencies [[camel-snake-kebab " 0.4.0 " ]
55 [clj-http " 2.3.0" ]
66 [com.draines/postal " 2.0.3" ]
77 [jakarta.servlet/jakarta.servlet-api " 4.0.4" ] ; ;5.x and 6.x did not work
Original file line number Diff line number Diff line change 223223 This function has the side effect of emptying the request body.
224224 Don't try to read the body again after calling this function."
225225 [body]
226- (string/trim (slurp ( java.io.InputStreamReader. body " UTF-8 " ) )))
226+ (string/trim (slurp body)))
227227
228228(defn read-multiple-body!
229229 " Returns the body content string by slurping the request body. This function
Original file line number Diff line number Diff line change 126126 request-context :update :provider-object provider-id)
127127 (acl/verify-provider-context-permission
128128 request-context :read :provider-object provider-id))
129- raw-document (slurp (java.io.InputStreamReader. ( :body request) " UTF-8 " ))
129+ raw-document (slurp (:body request))
130130 content-type (get headers " content-type" )
131131 ; ; get the version in content-type and verify it.
132132 version-ct (when (and content-type
375375 :bad-request
376376 (format " To publish a draft [%s] with a body, a json Content-Type header needs to be provided." concept-id))
377377 (try
378- (json/parse-string (string/trim (slurp ( java.io.InputStreamReader. body " UTF-8 " ) )))
378+ (json/parse-string (string/trim (slurp body)))
379379 (catch Exception e
380380 (errors/throw-service-error
381381 :bad-request
Original file line number Diff line number Diff line change 8181(defn read-body
8282 [headers body-input]
8383 (if (= mt/json (mt/content-type-mime-type headers))
84- (json/decode (slurp ( java.io.InputStreamReader. body-input " UTF-8 " ) ) true )
84+ (json/decode (slurp body-input) true )
8585 (srvc-errors/throw-service-error
8686 :invalid-content-type " Creating or updating a provider requires a JSON content type." )))
8787
Original file line number Diff line number Diff line change 159159(def translation-routes
160160 (context " /translate" []
161161 (POST " /collection" {:keys [body headers request-context params]}
162- (translate request-context :collection headers (slurp ( java.io.InputStreamReader. body " UTF-8 " ) )
162+ (translate request-context :collection headers (slurp body)
163163 (= " true" (:skip_umm_validation params))))
164164 (POST " /granule" {:keys [body headers request-context params]}
165- (translate request-context :granule headers (slurp ( java.io.InputStreamReader. body " UTF-8 " ) )
165+ (translate request-context :granule headers (slurp body)
166166 (= " true" (:skip_umm_validation params))))))
167167
168168(def random-metadata-routes
Original file line number Diff line number Diff line change 388388 params {:method method
389389 :url (url/ingest-url provider-id concept-type native-id)
390390 :body metadata
391- :content-type (if (string? format)
392- (str format " ; charset=utf-8" )
393- format)
391+ :content-type format
394392 :headers headers
395393 :throw-exceptions false
396394 :connection-manager (sys/conn-mgr )}
Original file line number Diff line number Diff line change 906906 (testing " without native-id provided with unicode in the name"
907907 (let [concept (dissoc (subscription-util/make-subscription-concept
908908 {:SubscriberId " post-user"
909- :Name " unicode-test Großartiger Scott!"
909+ :Name " unicode-test Gro \u 00dfartiger Scott!"
910910 :Query " instrument=POSEIDON-2B"
911911 :CollectionConceptId (:concept-id coll)})
912912 :native-id )
916916 :method :post })]
917917 (is (= 201 status))
918918 (is (not (nil? concept-id)))
919- (is (string/starts-with? native-id " unicode_test_großartiger " ))
919+ (is (string/starts-with? native-id " unicode_test_gro \u 00dfartiger " ))
920920 (is (= 1 revision-id))
921921
922922 (index/wait-until-indexed )
You can’t perform that action at this time.
0 commit comments