Skip to content

Commit

Permalink
Merge pull request #68 from aodn/feature/add-statement#5699
Browse files Browse the repository at this point in the history
add statement
  • Loading branch information
utas-raymondng authored Jul 17, 2024
2 parents e0a73c5 + 85491b9 commit 2e14d22
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ default <D extends StacCollectionModel> Collection getCollection(D m, String hos
);
}

if (m.getSummaries() != null && m.getSummaries().getStatement() != null) {
collection.getProperties().put(CollectionProperty.statement, m.getSummaries().getStatement());
}

return collection;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ public class SummariesModel {

@JsonProperty("temporal")
protected List<Map<String, String>> temporal;

protected String statement;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public enum CollectionProperty {
geometry("geometry"),
temporal("temporal"),
citation("citation"),
statement("statement"),
;

private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public void verifyAddingPropertyWorks() {
.build();
var citationString = "{\"suggestedCitation\":\"this is suggested Citation\",\"useLimitations\":[\"this is useLimitations1\",\"this is useLimitations2\"],\"otherConstraints\":[\"this is otherConstraints1\",\"this is otherConstraints2\"]}";

var statement = "This is the statement of this record";

StacCollectionModel model = StacCollectionModel
.builder()
.summaries(
Expand All @@ -82,6 +84,7 @@ public void verifyAddingPropertyWorks() {
.score(0)
.status("Completed")
.credits(credits)
.statement(statement)
.build()
)
.contacts(Collections.singletonList(contact))
Expand All @@ -100,5 +103,6 @@ public void verifyAddingPropertyWorks() {
Assertions.assertEquals("this is suggested Citation", checkedCitation.getSuggestedCitation());
Assertions.assertEquals(Arrays.asList("this is useLimitations1", "this is useLimitations2"), checkedCitation.getUseLimitations());
Assertions.assertEquals(Arrays.asList("this is otherConstraints1", "this is otherConstraints2"), checkedCitation.getOtherConstraints());
Assertions.assertEquals(statement, collection.getProperties().get(CollectionProperty.statement));
}
}

0 comments on commit 2e14d22

Please sign in to comment.