Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/resources/config/json-paths-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,10 @@ products:
description: "SWOT Global Sea Level Anomaly SSH products"
paths:
- /DR_SWOT/SSH/SSH.json

- product: "FishSOOP"
description: "FishSOOP temperature profiles and anomalies"
paths:
- /fishsoop/fishSOOP-profiles.json
- /fishsoop/fishSOOP-quarterlyAnomalies.json
- /fishsoop/fishSOOP-depthAnomalies.json
13 changes: 13 additions & 0 deletions src/main/resources/config/products.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,16 @@ ocean-current:
id: "swotGsla-ssh"
- title: "MDT"
id: "swotGsla-mdt"

- title: "FishSOOP"
id: "fishSOOP"
type: "ProductGroup"
children:
- title: "Regional Profiles"
id: "fishSOOP-profiles"
- title: "Quarterly Anomalies"
id: "fishSOOP-quarterlyAnomalies"
regionRequired: false
- title: "Depth Anomalies"
id: "fishSOOP-depthAnomalies"
regionRequired: false
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,17 @@ void swotGslaShouldNotIndexMdt() {
assertThat(entry).isPresent();
assertThat(entry.get().getPaths()).noneMatch(p -> p.contains("MDT") || p.contains("MDTCMEMS"));
}

@Test
void fishSoopShouldHaveThreeJsonPaths() {
Optional<JsonPath> entry = config.getProducts().stream()
.filter(p -> p.getProduct().equals("FishSOOP"))
.findFirst();
assertThat(entry).isPresent();
assertThat(entry.get().getPaths()).containsExactly(
"/fishsoop/fishSOOP-profiles.json",
"/fishsoop/fishSOOP-quarterlyAnomalies.json",
"/fishsoop/fishSOOP-depthAnomalies.json"
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,40 @@ void swotGslaGroupShouldContainSshAndMdtChildren() {
assertThat(productMap).containsKey(child.getId());
});
}

@Test
void fishSoopGroupShouldContainExpectedChildren() {
Product fishSoop = productGroupMap.get("fishSOOP");
assertThat(fishSoop).isNotNull();
assertThat(fishSoop.getTitle()).isEqualTo("FishSOOP");

List<String> childIds = fishSoop.getChildren().stream().map(Product::getId).collect(Collectors.toList());
assertThat(childIds).containsExactlyInAnyOrder(
"fishSOOP-profiles",
"fishSOOP-quarterlyAnomalies",
"fishSOOP-depthAnomalies"
);

fishSoop.getChildren().forEach(child -> {
assertThat(child.getParentId()).isEqualTo("fishSOOP");
assertThat(child.getParentTitle()).isEqualTo("FishSOOP");
assertThat(productMap).containsKey(child.getId());
});
}

@Test
void fishSoopRegionFlagsShouldMatchConfig() {
// Profiles are per-region; the anomaly products index region-less records (region: null)
Product profiles = productMap.get("fishSOOP-profiles");
assertThat(profiles).isNotNull();
assertThat(profiles.isRegionRequired()).isTrue();

Product quarterlyAnomalies = productMap.get("fishSOOP-quarterlyAnomalies");
assertThat(quarterlyAnomalies).isNotNull();
assertThat(quarterlyAnomalies.isRegionRequired()).isFalse();

Product depthAnomalies = productMap.get("fishSOOP-depthAnomalies");
assertThat(depthAnomalies).isNotNull();
assertThat(depthAnomalies.isRegionRequired()).isFalse();
}
}