Skip to content

Commit 6029bec

Browse files
authored
[GH-2348] Fix STAC tests resilience to external server failures in Scala (#2350)
* Fix the STAC reader scala unit tests to remove dependency on remote services * address review comments
1 parent 4ac1e48 commit 6029bec

File tree

11 files changed

+918
-29
lines changed

11 files changed

+918
-29
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"id": "copernicus-dem",
3+
"type": "Collection",
4+
"stac_extensions": [
5+
"https://stac-extensions.github.io/raster/v1.1.0/schema.json"
6+
],
7+
"stac_version": "1.0.0",
8+
"description": "Mock Copernicus DEM collection for testing",
9+
"title": "Mock Copernicus Digital Elevation Model",
10+
"keywords": [
11+
"copernicus",
12+
"dem",
13+
"elevation"
14+
],
15+
"providers": [
16+
{
17+
"name": "Mock Earth Data Hub",
18+
"description": "Mock Copernicus Earth Data Hub",
19+
"roles": [
20+
"producer"
21+
],
22+
"url": "http://mock-earthdatahub.example.com"
23+
}
24+
],
25+
"extent": {
26+
"spatial": {
27+
"bbox": [
28+
[
29+
-180.0,
30+
-90.0,
31+
180.0,
32+
90.0
33+
]
34+
]
35+
},
36+
"temporal": {
37+
"interval": [
38+
[
39+
"2021-01-01T00:00:00Z",
40+
"2021-12-31T23:59:59Z"
41+
]
42+
]
43+
}
44+
},
45+
"license": "proprietary",
46+
"links": [
47+
{
48+
"rel": "root",
49+
"href": "collection.json",
50+
"type": "application/json"
51+
},
52+
{
53+
"rel": "self",
54+
"href": "collection.json",
55+
"type": "application/json"
56+
},
57+
{
58+
"rel": "item",
59+
"href": "mock-dem-item.json",
60+
"type": "application/json"
61+
}
62+
]
63+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"id": "earthview-catalog",
3+
"type": "Catalog",
4+
"stac_version": "1.0.0",
5+
"description": "Mock Satellogic EarthView catalog for testing",
6+
"title": "Mock Satellogic EarthView Catalog",
7+
"keywords": [
8+
"satellogic",
9+
"earthview",
10+
"satellite"
11+
],
12+
"providers": [
13+
{
14+
"name": "Mock Satellogic",
15+
"description": "Mock Satellogic EarthView",
16+
"roles": [
17+
"producer"
18+
],
19+
"url": "http://mock-satellogic.example.com"
20+
}
21+
],
22+
"extent": {
23+
"spatial": {
24+
"bbox": [
25+
[
26+
-180.0,
27+
-90.0,
28+
180.0,
29+
90.0
30+
]
31+
]
32+
},
33+
"temporal": {
34+
"interval": [
35+
[
36+
"2020-01-01T00:00:00Z",
37+
"2023-12-31T23:59:59Z"
38+
]
39+
]
40+
}
41+
},
42+
"license": "proprietary",
43+
"links": [
44+
{
45+
"rel": "root",
46+
"href": "catalog.json",
47+
"type": "application/json"
48+
},
49+
{
50+
"rel": "self",
51+
"href": "catalog.json",
52+
"type": "application/json"
53+
},
54+
{
55+
"rel": "item",
56+
"href": "mock-earthview-item.json",
57+
"type": "application/json"
58+
}
59+
]
60+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"id": "naip",
3+
"type": "Collection",
4+
"stac_extensions": [
5+
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
6+
"https://stac-extensions.github.io/raster/v1.1.0/schema.json"
7+
],
8+
"stac_version": "1.0.0",
9+
"description": "Mock NAIP (National Agriculture Imagery Program) collection for testing",
10+
"title": "Mock NAIP: National Agriculture Imagery Program",
11+
"keywords": [
12+
"naip",
13+
"aerial",
14+
"imagery"
15+
],
16+
"providers": [
17+
{
18+
"name": "Mock Planetary Computer",
19+
"description": "Mock Microsoft Planetary Computer",
20+
"roles": [
21+
"host"
22+
],
23+
"url": "http://mock-planetarycomputer.example.com"
24+
}
25+
],
26+
"extent": {
27+
"spatial": {
28+
"bbox": [
29+
[
30+
-160.0,
31+
18.0,
32+
-64.0,
33+
50.0
34+
]
35+
]
36+
},
37+
"temporal": {
38+
"interval": [
39+
[
40+
"2009-01-01T00:00:00Z",
41+
"2022-12-31T23:59:59Z"
42+
]
43+
]
44+
}
45+
},
46+
"license": "proprietary",
47+
"links": [
48+
{
49+
"rel": "root",
50+
"href": "collection.json",
51+
"type": "application/json"
52+
},
53+
{
54+
"rel": "self",
55+
"href": "collection.json",
56+
"type": "application/json"
57+
},
58+
{
59+
"rel": "item",
60+
"href": "mock-naip-item.json",
61+
"type": "application/json"
62+
}
63+
]
64+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"id": "sentinel-2-pre-c1-l2a",
3+
"type": "Collection",
4+
"stac_extensions": [
5+
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
6+
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
7+
"https://stac-extensions.github.io/view/v1.0.0/schema.json"
8+
],
9+
"stac_version": "1.0.0",
10+
"description": "Mock Sentinel-2 Pre-Collection 1 Level-2A collection for testing",
11+
"title": "Mock Sentinel-2 Pre-Collection 1 Level-2A",
12+
"keywords": [
13+
"sentinel",
14+
"earth observation",
15+
"esa"
16+
],
17+
"providers": [
18+
{
19+
"name": "Mock Earth Search",
20+
"description": "Mock provider for testing",
21+
"roles": [
22+
"producer",
23+
"processor"
24+
],
25+
"url": "http://mock-earth-search.example.com"
26+
}
27+
],
28+
"extent": {
29+
"spatial": {
30+
"bbox": [
31+
[
32+
-180.0,
33+
-90.0,
34+
180.0,
35+
90.0
36+
]
37+
]
38+
},
39+
"temporal": {
40+
"interval": [
41+
[
42+
"2015-06-23T00:00:00Z",
43+
"2021-12-31T23:59:59Z"
44+
]
45+
]
46+
}
47+
},
48+
"license": "proprietary",
49+
"links": [
50+
{
51+
"rel": "root",
52+
"href": "https://earth-search.aws.element84.com/v1",
53+
"type": "application/json"
54+
},
55+
{
56+
"rel": "parent",
57+
"href": "https://earth-search.aws.element84.com/v1",
58+
"type": "application/json"
59+
},
60+
{
61+
"rel": "self",
62+
"href": "https://earth-search.aws.element84.com/v1/collections/sentinel-2-pre-c1-l2a",
63+
"type": "application/json"
64+
},
65+
{
66+
"rel": "item",
67+
"href": "mock-item-1.json",
68+
"type": "application/json"
69+
},
70+
{
71+
"rel": "item",
72+
"href": "mock-item-2.json",
73+
"type": "application/json"
74+
},
75+
{
76+
"rel": "item",
77+
"href": "mock-item-3.json",
78+
"type": "application/json"
79+
},
80+
{
81+
"rel": "item",
82+
"href": "mock-item-4.json",
83+
"type": "application/json"
84+
},
85+
{
86+
"rel": "item",
87+
"href": "mock-item-5.json",
88+
"type": "application/json"
89+
}
90+
],
91+
"summaries": {
92+
"platform": [
93+
"sentinel-2a",
94+
"sentinel-2b"
95+
],
96+
"constellation": [
97+
"sentinel-2"
98+
],
99+
"instruments": [
100+
"msi"
101+
]
102+
}
103+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"id": "vegetation-collection",
3+
"type": "Collection",
4+
"stac_extensions": [
5+
"https://stac-extensions.github.io/raster/v1.1.0/schema.json"
6+
],
7+
"stac_version": "1.0.0",
8+
"description": "Mock vegetation collection for testing",
9+
"title": "Mock Vegetation Collection",
10+
"keywords": [
11+
"vegetation",
12+
"canopy",
13+
"height"
14+
],
15+
"providers": [
16+
{
17+
"name": "Mock CFO",
18+
"description": "Mock California Forest Observatory",
19+
"roles": [
20+
"producer"
21+
],
22+
"url": "http://mock-cfo.example.com"
23+
}
24+
],
25+
"extent": {
26+
"spatial": {
27+
"bbox": [
28+
[
29+
-124.4096,
30+
32.5342,
31+
-114.1308,
32+
42.0095
33+
]
34+
]
35+
},
36+
"temporal": {
37+
"interval": [
38+
[
39+
"2016-01-01T00:00:00Z",
40+
"2016-12-31T23:59:59Z"
41+
]
42+
]
43+
}
44+
},
45+
"license": "CC-BY-4.0",
46+
"links": [
47+
{
48+
"rel": "root",
49+
"href": "collection.json",
50+
"type": "application/json"
51+
},
52+
{
53+
"rel": "self",
54+
"href": "collection.json",
55+
"type": "application/json"
56+
},
57+
{
58+
"rel": "item",
59+
"href": "California-Vegetation-CanopyBaseHeight-2016-Summer-00010m.json",
60+
"type": "application/json"
61+
}
62+
]
63+
}

0 commit comments

Comments
 (0)