Skip to content

Commit a20520e

Browse files
committed
test iso metadata has contact link and whitespace in linkUrl now to verify things are being removed/cleaned
1 parent abec16e commit a20520e

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

schemas-parse/src/test/groovy/org/cedar/schemas/parse/ISOParserSpec.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.cedar.schemas.parse
22

3-
import org.cedar.schemas.avro.psi.Discovery
43
import org.cedar.schemas.avro.geojson.LineStringType
54
import org.cedar.schemas.avro.geojson.PointType
65
import org.cedar.schemas.avro.geojson.PolygonType
@@ -370,10 +369,10 @@ class ISOParserSpec extends Specification {
370369
then:
371370
links instanceof List
372371
links.every { it instanceof Link }
373-
links.size() == 1
372+
links.size() == 1 // Distributor Contact link should not appear
374373
links[0].linkName == 'Super Important Access Link'
375374
links[0].linkProtocol == 'HTTP'
376-
links[0].linkUrl == 'http://www.example.com'
375+
links[0].linkUrl == 'http://www.example.com' // Whitespace needs to be cleaned up
377376
links[0].linkDescription == 'Everything Important, All In One Place'
378377
links[0].linkFunction == 'search'
379378
}

schemas-parse/src/test/resources/test-iso-metadata.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@
13591359
<gmd:onLine>
13601360
<gmd:CI_OnlineResource>
13611361
<gmd:linkage>
1362-
<gmd:URL>http://www.example.com</gmd:URL>
1362+
<gmd:URL> http://www.example.com </gmd:URL>
13631363
</gmd:linkage>
13641364
<gmd:protocol>
13651365
<gco:CharacterString>HTTP</gco:CharacterString>
@@ -1380,6 +1380,24 @@
13801380
</gmd:onLine>
13811381
</gmd:MD_DigitalTransferOptions>
13821382
</gmd:distributorTransferOptions>
1383+
<gmd:distributorContact>
1384+
<gmd:CI_ResponsibleParty>
1385+
<gmd:contactInfo>
1386+
<gmd:CI_Contact>
1387+
<gmd:onlineResource>
1388+
<gmd:CI_OnlineResource>
1389+
<gmd:linkage>
1390+
<gmd:URL>http://www.contact-example.com</gmd:URL>
1391+
</gmd:linkage>
1392+
<gmd:name>
1393+
<gco:CharacterString>Contact Link That Shouldn't Appear</gco:CharacterString>
1394+
</gmd:name>
1395+
</gmd:CI_OnlineResource>
1396+
</gmd:onlineResource>
1397+
</gmd:CI_Contact>
1398+
</gmd:contactInfo>
1399+
</gmd:CI_ResponsibleParty>
1400+
</gmd:distributorContact>
13831401
</gmd:MD_Distributor>
13841402
</gmd:distributor>
13851403
<gmd:distributionFormat>

0 commit comments

Comments
 (0)