Skip to content

Commit 015faaf

Browse files
author
Jay Barra
authored
CMR-7235 opendap append with umm-g (#1251)
* CMR-7235 fixed logic where umm-g opendap url could be dropped * CMR-7235 updated tests for fixed behavior
1 parent 83a5977 commit 015faaf

File tree

2 files changed

+41
-12
lines changed
  • ingest-app
    • src/cmr/ingest/services/granule_bulk_update/opendap
    • test/cmr/ingest/services/granule_bulk_update/opendap

2 files changed

+41
-12
lines changed

ingest-app/src/cmr/ingest/services/granule_bulk_update/opendap/umm_g.clj

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@
5555

5656
_ (opendap-util/validate-append-no-conflicts opendap-urls url-map)
5757

58-
other-urls (remove is-opendap? related-urls)
5958
cloud-url (urls->updated-url :cloud opendap-urls url-map)
6059
on-prem-url (urls->updated-url :on-prem opendap-urls url-map)
61-
updated-urls (conj other-urls cloud-url on-prem-url)]
60+
updated-urls (conj related-urls cloud-url on-prem-url)]
6261
(remove nil? updated-urls)))
6362

6463
(defn update-opendap-url

ingest-app/test/cmr/ingest/services/granule_bulk_update/opendap/umm_g_test.clj

+40-10
Original file line numberDiff line numberDiff line change
@@ -158,29 +158,59 @@
158158
"non-matching RelatedUrls in metadata, on-prem url update"
159159
"http://example.com/foo"
160160
{:RelatedUrls [doc-related-url]}
161-
{:RelatedUrls [{:URL "http://example.com/foo"
161+
{:RelatedUrls [doc-related-url
162+
{:URL "http://example.com/foo"
162163
:Type "USE SERVICE API"
163-
:Subtype "OPENDAP DATA"}
164-
doc-related-url]}
164+
:Subtype "OPENDAP DATA"}]}
165165

166166
"non-matching RelatedUrls in metadata, cloud url update"
167167
"https://opendap.earthdata.nasa.gov/foo"
168168
{:RelatedUrls [doc-related-url]}
169-
{:RelatedUrls [{:URL "https://opendap.earthdata.nasa.gov/foo"
169+
{:RelatedUrls [doc-related-url
170+
{:URL "https://opendap.earthdata.nasa.gov/foo"
170171
:Type "USE SERVICE API"
171-
:Subtype "OPENDAP DATA"}
172-
doc-related-url]}
172+
:Subtype "OPENDAP DATA"}]}
173173

174174
"non-matching RelatedUrls in metadata, cloud url and on-prem url update"
175175
"http://example.com/foo, https://opendap.earthdata.nasa.gov/foo"
176176
{:RelatedUrls [doc-related-url]}
177-
{:RelatedUrls [{:URL "http://example.com/foo"
178-
:Type "USE SERVICE API"
179-
:Subtype "OPENDAP DATA"}
177+
{:RelatedUrls [doc-related-url
180178
{:URL "https://opendap.earthdata.nasa.gov/foo"
181179
:Type "USE SERVICE API"
182180
:Subtype "OPENDAP DATA"}
183-
doc-related-url]}))
181+
{:URL "http://example.com/foo"
182+
:Type "USE SERVICE API"
183+
:Subtype "OPENDAP DATA"}]}
184+
185+
"existing cloud, appending on-prem"
186+
"https://example.com/addr"
187+
{:RelatedUrls
188+
[{:URL "https://opendap.uat.earthdata.nasa.gov/to_be_updated"
189+
:Type "GET DATA"
190+
:Subtype "OPENDAP DATA"
191+
:Description "cloud OPeNDAP Documentation"}]}
192+
{:RelatedUrls
193+
[{:URL "https://opendap.uat.earthdata.nasa.gov/to_be_updated"
194+
:Type "GET DATA"
195+
:Subtype "OPENDAP DATA"
196+
:Description "cloud OPeNDAP Documentation"}
197+
{:URL "https://example.com/addr"
198+
:Type "USE SERVICE API"
199+
:Subtype "OPENDAP DATA"}]}
200+
201+
"existing on-prem, appending cloud"
202+
"https://opendap.uat.earthdata.nasa.gov/new"
203+
{:RelatedUrls
204+
[{:URL "https://example.com/addr"
205+
:Type "GET DATA"
206+
:Subtype "OPENDAP DATA"}]}
207+
{:RelatedUrls
208+
[{:URL "https://example.com/addr"
209+
:Type "GET DATA"
210+
:Subtype "OPENDAP DATA"}
211+
{:URL "https://opendap.uat.earthdata.nasa.gov/new"
212+
:Type "USE SERVICE API"
213+
:Subtype "OPENDAP DATA"}]}))
184214

185215
(testing "throws when appropriate"
186216
(are3 [url-value source]

0 commit comments

Comments
 (0)