-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
a9a6012
commit 1b727ed
Showing
9 changed files
with
119 additions
and
63 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
kotlin.code.style=official | ||
version=0.4 |
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ data class Error( | |
) | ||
|
||
|
||
enum class EndpointType { | ||
enum class EndpointType() { | ||
GET, | ||
PUT, | ||
POST, | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
|
||
fun main(args: Array<String>) { | ||
LoggerSettings.loggerStyle = LoggerStyle.BRACKET_PREFIX_WHITE_TEXT | ||
//hello person reading this. I hope you are having a nice day <3 | ||
} |
This file was deleted.
Oops, something went wrong.
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
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,43 @@ | ||
import org.junit.jupiter.api.AfterAll | ||
import org.junit.jupiter.api.Test | ||
import kotlin.test.assertEquals | ||
|
||
class TypeTests { | ||
|
||
init { | ||
newServer() | ||
} | ||
|
||
companion object { | ||
private var server: LightweightWebServer? = null | ||
|
||
private fun newServer() { | ||
server?.end() | ||
server = LightweightWebServer(6900) | ||
} | ||
|
||
@JvmStatic | ||
@AfterAll | ||
fun `end server`(): Unit { | ||
server?.end() | ||
} | ||
} | ||
|
||
@Test | ||
fun `test types pass`() { | ||
server?.get("/body") { | ||
it.respond("yep :3") | ||
} | ||
val response = testRequest("/body", "you there?") | ||
assertEquals(200, response.statusCode()) | ||
} | ||
|
||
@Test | ||
fun `test types fail`() { | ||
server?.post("/body") { | ||
it.respond("yep :3") | ||
} | ||
val response = testRequest("/body", "you there?") | ||
assertEquals(500, response.statusCode()) | ||
} | ||
} |