Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
utas-raymondng committed Jan 17, 2025
1 parent 088cc7c commit 7e26caf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ public void verifyToStacItemModel() throws IOException {
Assertions.assertTrue(t.isPresent(), "Target found");
Assertions.assertEquals(15L, t.get().getProperties().get("count"));

Assertions.assertNotNull(t.get().getGeometry().get("properties"), "geometry properties no null");
Assertions.assertInstanceOf(Map.class, t.get().getGeometry().get("properties"));

Map<?, ?> properties = t.get().getProperties();
// The depth is a BigDecimal, so we do a toString() will force it print the .00 which is what we want
// to check it contains two decimal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ public void verifyLandStrippedFromSpatialExtentsWithReducerOn() throws IOExcepti
assertEquals(118.0, ncoors[4].getX(), 0.00);
assertEquals(-36.0, ncoors[4].getY(), 0.00);
}

/**
* Given a point call this function return a GeometryCollection contain a single point
*/
@Test
public void verifyCreateJsonPoint() {
Map<?,?> item = GeometryUtils.createGeoShapeJson(
Expand All @@ -148,14 +150,13 @@ public void verifyCreateJsonPoint() {
);

Assertions.assertNotNull(item);
Assertions.assertEquals("Feature", item.get("type"));
Assertions.assertInstanceOf(Map.class, item.get("geometry"));
Assertions.assertEquals("GeometryCollection", item.get("type"));
Assertions.assertInstanceOf(List.class, item.get("geometries"));

Map<?, ?> geometry = (Map<?,?>)item.get("geometry");
Assertions.assertInstanceOf(List.class, geometry.get("coordinates"));
List<Map<?,?>> geometries = (List<Map<?,?>>)item.get("geometries");
Assertions.assertInstanceOf(List.class, geometries.get(0).get("coordinates"));

Assertions.assertInstanceOf(List.class, geometry.get("coordinates"));
List<?> coors = (List<?>)geometry.get("coordinates");
List<?> coors = (List<?>)geometries.get(0).get("coordinates");
Assertions.assertEquals(1.2, coors.get(0));
Assertions.assertEquals(2.2, coors.get(1));
}
Expand Down

0 comments on commit 7e26caf

Please sign in to comment.