-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bartlomiej.zylinski
committed
May 23, 2024
1 parent
4ce8510
commit 9497cbc
Showing
4 changed files
with
50 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package sttp.model | ||
|
||
import org.scalatest.TryValues | ||
import org.scalatest.funsuite.AnyFunSuite | ||
import org.scalatest.matchers.should.Matchers | ||
import sttp.model.Uri._ | ||
|
||
class UriTestsHelper extends AnyFunSuite with Matchers with TryValues { | ||
|
||
val QS = QuerySegment | ||
|
||
val testUri = Uri.unsafeApply("http", None, "example.com", None, Nil, Nil, None) | ||
|
||
val querySegmentsTestData = List( | ||
List(QS.KeyValue("k", "v1~v2", valueEncoding = QuerySegmentEncoding.All)) -> "k=v1~v2" | ||
) | ||
|
||
for { | ||
(segments, expected) <- querySegmentsTestData | ||
} { | ||
test(s"$segments should serialize to$expected") { | ||
testUri.copy(querySegments = segments).toString should endWith(expected) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package sttp.model | ||
|
||
import org.scalatest.TryValues | ||
import org.scalatest.funsuite.AnyFunSuite | ||
import org.scalatest.matchers.should.Matchers | ||
import sttp.model.Uri._ | ||
|
||
class UriTestsHelper extends AnyFunSuite with Matchers with TryValues { | ||
|
||
val QS = QuerySegment | ||
|
||
val testUri = Uri.unsafeApply("http", None, "example.com", None, Nil, Nil, None) | ||
|
||
val querySegmentsTestData = List( | ||
List(QS.KeyValue("k", "v1~v2", valueEncoding = QuerySegmentEncoding.All)) -> "k=v1%7Ev2" | ||
) | ||
|
||
for { | ||
(segments, expected) <- querySegmentsTestData | ||
} { | ||
test(s"$segments should serialize to$expected") { | ||
testUri.copy(querySegments = segments).toString should endWith(expected) | ||
} | ||
} | ||
} |