refactor: improve readability of IoResourceTest by formatting RestAssured calls
Build & Test (NowChessSystems) TeamCity build failed
Build & Test (NowChessSystems) TeamCity build failed
This commit is contained in:
@@ -12,10 +12,10 @@ import io.restassured.http.ContentType
|
||||
import org.junit.jupiter.api.Assertions.*
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
// scalafix:off
|
||||
@QuarkusTest
|
||||
class IoResourceTest:
|
||||
|
||||
// scalafix:off
|
||||
private lazy val testMapper: ObjectMapper =
|
||||
val m = new ObjectMapper()
|
||||
val mod = new SimpleModule()
|
||||
@@ -29,7 +29,8 @@ class IoResourceTest:
|
||||
|
||||
@Test
|
||||
def importFenReturns200(): Unit =
|
||||
val resp = RestAssured.`given`()
|
||||
val resp = RestAssured
|
||||
.`given`()
|
||||
.contentType(ContentType.JSON)
|
||||
.body("""{"fen":"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1"}""")
|
||||
.post("/io/import/fen")
|
||||
@@ -37,7 +38,8 @@ class IoResourceTest:
|
||||
|
||||
@Test
|
||||
def importFenInvalidReturns400(): Unit =
|
||||
val resp = RestAssured.`given`()
|
||||
val resp = RestAssured
|
||||
.`given`()
|
||||
.contentType(ContentType.JSON)
|
||||
.body("""{"fen":"not-a-fen"}""")
|
||||
.post("/io/import/fen")
|
||||
@@ -45,7 +47,8 @@ class IoResourceTest:
|
||||
|
||||
@Test
|
||||
def importPgnReturns200(): Unit =
|
||||
val resp = RestAssured.`given`()
|
||||
val resp = RestAssured
|
||||
.`given`()
|
||||
.contentType(ContentType.JSON)
|
||||
.body("""{"pgn":"1. e4 e5"}""")
|
||||
.post("/io/import/pgn")
|
||||
@@ -53,7 +56,8 @@ class IoResourceTest:
|
||||
|
||||
@Test
|
||||
def importPgnInvalidReturns400(): Unit =
|
||||
val resp = RestAssured.`given`()
|
||||
val resp = RestAssured
|
||||
.`given`()
|
||||
.contentType(ContentType.JSON)
|
||||
.body("""{"pgn":"not valid pgn !!!###"}""")
|
||||
.post("/io/import/pgn")
|
||||
@@ -61,7 +65,8 @@ class IoResourceTest:
|
||||
|
||||
@Test
|
||||
def exportFenReturns200WithFen(): Unit =
|
||||
val resp = RestAssured.`given`()
|
||||
val resp = RestAssured
|
||||
.`given`()
|
||||
.contentType(ContentType.JSON)
|
||||
.body(contextJson(GameContext.initial))
|
||||
.post("/io/export/fen")
|
||||
@@ -70,7 +75,8 @@ class IoResourceTest:
|
||||
|
||||
@Test
|
||||
def exportPgnReturns200(): Unit =
|
||||
val resp = RestAssured.`given`()
|
||||
val resp = RestAssured
|
||||
.`given`()
|
||||
.contentType(ContentType.JSON)
|
||||
.body(contextJson(GameContext.initial))
|
||||
.post("/io/export/pgn")
|
||||
|
||||
Reference in New Issue
Block a user