-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sjekker at url har query parametere før vi eventuelt bruker url templ…
…ate (#227) * Sjekker at url har queryparamtere. * Refaktorerer tilUrlTemplate og lager tester
- Loading branch information
1 parent
25a9f8d
commit fa18872
Showing
2 changed files
with
30 additions
and
5 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
24 changes: 24 additions & 0 deletions
24
dusseldorf-ktor-core/src/test/kotlin/no/nav/helse/dusseldorf/ktor/core/UrlTemplateTest.kt
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,24 @@ | ||
package no.nav.helse.dusseldorf.ktor.core | ||
|
||
import org.junit.Test | ||
import kotlin.test.assertEquals | ||
|
||
class UrlTemplateTest { | ||
|
||
@Test | ||
fun `Test url med query parameters`(){ | ||
assertEquals( | ||
"http://localhost.no/dokument?eier={eier}&navn={navn}", | ||
"http://localhost.no/dokument?eier=123&navn=noe".templateQueryParameters() | ||
) | ||
} | ||
|
||
@Test | ||
fun `Test url uten query parameters`(){ | ||
assertEquals( | ||
"http://localhost.no/dokument", | ||
"http://localhost.no/dokument".templateQueryParameters() | ||
) | ||
} | ||
|
||
} |