Skip to content

Commit c2b11e9

Browse files
committed
Adjust tests
1 parent 5d7fd2f commit c2b11e9

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

store/src/main/scala/geotrellis/store/GeoTrellisPath.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ object GeoTrellisPath {
5555
implicit def toGeoTrellisDataPath(path: String): GeoTrellisPath = parse(path)
5656

5757
def parseOption(path: String): Option[GeoTrellisPath] = {
58-
val layerNameParam: String = "layer"
59-
val zoomLevelParam: String = "zoom"
60-
val bandCountParam: String = "band_count"
58+
val layerNameParam = "layer"
59+
val zoomLevelParam = "zoom"
60+
val bandCountParam = "band_count"
6161

6262
val uri = UrlWithAuthority.parseOption(path).fold(Url.parse(path))(identity)
6363
val queryString = uri.query
@@ -70,18 +70,18 @@ object GeoTrellisPath {
7070
case _ => ""
7171
}
7272

73-
val queryStringClean = {
73+
val queryStringFiltered = {
7474
val filtered = queryString.removeAll(layerNameParam, zoomLevelParam, bandCountParam)
7575
if(filtered.isEmpty) "" else s"?${filtered.toString()}"
7676
}
7777

78-
s"${scheme.split("\\+").last}://$authority${uri.path}$queryStringClean".trim.some
78+
s"${scheme.split("\\+").last}://$authority${uri.path}$queryStringFiltered".trim.some
7979
}
8080

8181
catalogPath.fold(Option.empty[GeoTrellisPath]) { catalogPath =>
82-
val maybeLayerName: Option[String] = queryString.param(layerNameParam)
83-
val maybeZoomLevel: Option[Int] = queryString.param(zoomLevelParam).map(_.toInt)
84-
val bandCount: Option[Int] = queryString.param(bandCountParam).map(_.toInt)
82+
val maybeLayerName = queryString.param(layerNameParam)
83+
val maybeZoomLevel = queryString.param(zoomLevelParam).map(_.toInt)
84+
val bandCount = queryString.param(bandCountParam).map(_.toInt)
8585

8686
(maybeLayerName, maybeZoomLevel) match {
8787
case (Some(layerName), Some(zoomLevel)) =>

store/src/test/scala/geotrellis/store/GeoTrellisPathSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class GeoTrellisPathSpec extends AnyFunSpec {
106106
assert(path.layerName == "foo")
107107
}
108108

109-
it("should ignore invalid parameters") {
109+
it("should not ignore invalid parameters") {
110110
val path = GeoTrellisPath.parse("file:///foo/bar?layer=baz&zoom=1&invalid=not&nope=1")
111-
assert(path == GeoTrellisPath("file:///foo/bar", "baz", 1, None))
111+
assert(path == GeoTrellisPath("file:///foo/bar?invalid=not&nope=1", "baz", 1, None))
112112
}
113113
}
114114
}

0 commit comments

Comments
 (0)