Skip to content

Commit

Permalink
test xptn SpatialFilter with invalid geometry
Browse files Browse the repository at this point in the history
Signed-off-by: qGYdXbY2 <[email protected]>
  • Loading branch information
qGYdXbY2 committed Aug 19, 2024
1 parent baa7acc commit b436140
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;

import com.here.xyz.httpconnector.CService;
import com.here.xyz.httpconnector.util.jobs.Export;
Expand Down Expand Up @@ -100,25 +101,6 @@ public void createJobWithExistingId(){
.statusCode(CONFLICT.code());
}

/* commented out, as SpatialFilter().withGeometry(.invalid.) is now throwing an exception
@Test
public void createJobWithInvalidFilter() {
// Create job
Export job = new Export()
.withId(testJobId + CService.currentTimeMillis())
.withDescription("Job Description")
.withExportTarget(new Export.ExportTarget().withType(Export.ExportTarget.Type.DOWNLOAD))
.withCsvFormat(Job.CSVFormat.GEOJSON);
job.setFilters(new Filters().withSpatialFilter(new SpatialFilter().withGeometry(new Point().withCoordinates(new PointCoordinates(399,399)))));
postJob(job,getScopedSpaceId(testSpaceId1, scope))
.statusCode(BAD_REQUEST.code());
//Add check if no config exists
}
*/

@Test
public void getJob(){
/** Create job */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.here.xyz.hub.rest.jobs;

import static org.junit.Assert.assertThrows;

import org.junit.Test;

import com.here.xyz.jobs.datasets.filters.SpatialFilter;
import com.here.xyz.models.geojson.coordinates.PointCoordinates;
import com.here.xyz.models.geojson.exceptions.InvalidGeometryException;
import com.here.xyz.models.geojson.implementation.Point;

public class JobDatasetsIT {


@Test
public void createInvalidSpatialFilter() {

assertThrows(InvalidGeometryException.class,
() -> new SpatialFilter().withGeometry(new Point().withCoordinates(new PointCoordinates(399,399))));

}


}

0 comments on commit b436140

Please sign in to comment.