Skip to content

Commit

Permalink
Fix STAC asset tests
Browse files Browse the repository at this point in the history
!build-snapshot
  • Loading branch information
inigo-cobian committed Feb 27, 2025
1 parent 2ce8fb0 commit 24b4a2c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ public void testCreateValidStacAsset() throws JsonProcessingException {
assertEquals(0.0, asset.getNoValue());
}

public void testCreateInvalidStacAssetTypeInformationNotAvailable() throws JsonProcessingException {
public void testCreateInvalidStacAssetNoTypeButValidExtension() throws JsonProcessingException {
String assetJSON = "{\"title\":\"Band 1 (coastal) BOA reflectance\",\"roles\":[\"data\"],\"gsd\":60,\"eo:bands\":[{\"name\":\"B01\",\"common_name\":\"coastal\",\"center_wavelength\":0.4439,\"full_width_half_max\":0.027}],\"href\":\"https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/33/S/VB/2021/2/S2B_33SVB_20210221_0_L2A/B01.tif\",\"proj:shape\":[1830,1830],\"proj:transform\":[60,0,399960,0,-60,4200000,0,0,1],\"raster:bands\":[{\"data_type\":\"uint16\",\"spatial_resolution\":60,\"bits_per_sample\":15,\"nodata\":0,\"statistics\":{\"minimum\":1,\"maximum\":20567,\"mean\":2339.4759595597,\"stddev\":3026.6973619954,\"valid_percent\":99.83}}]}";
JsonNode node = mapper.readTree(assetJSON);

HMStacAsset asset = new HMStacAsset("B01", node);

assertFalse(asset.isValid());
assertEquals("type information not available", asset.getNonValidReason());
assertTrue(asset.isValid());
}

public void testCreateInvalidStacAssetNotAValidType() throws JsonProcessingException {
Expand Down

0 comments on commit 24b4a2c

Please sign in to comment.