Skip to content

Commit c4194bd

Browse files
author
Adam Collins
committed
fix tests
1 parent 0b64f27 commit c4194bd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/groovy/au/org/ala/spatial/process/PointsToGrid.groovy

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class PointsToGrid extends SlaveProcess {
7171

7272
// dump the species data to a file
7373
taskLog("getting species data")
74-
Records records = new Records(speciesArea.bs.toString(), speciesArea.q.join('&fq='), bbox, null, null, "names_and_lsid", false)
74+
Records records = getRecords(speciesArea.bs.toString(), speciesArea.q.join('&fq='), bbox)
7575

7676
//update bbox with spatial extent of records
7777
double minx = 180, miny = 90, maxx = -180, maxy = -90
@@ -218,4 +218,8 @@ class PointsToGrid extends SlaveProcess {
218218
fw.close()
219219
}
220220

221+
// Isolate method for mocking
222+
def getRecords(String bs, String q, double[] bbox) {
223+
return new Records(bs, q, bbox, null, null, "names_and_lsid", false)
224+
}
221225
}

src/test/groovy/au/org/ala/spatial/process/PointsToGridSpec.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class PointsToGridSpec extends Specification implements GrailsUnitTest {
7474
}
7575

7676
@Override
77-
def getRecords(String bs, String q, double[] bbox, String filename, SimpleRegion region) {
77+
def getRecords(String bs, String q, double[] bbox) {
7878
new RecordsMock(tmpCsv)
7979
}
8080
}

0 commit comments

Comments
 (0)