diff --git a/bruno/backcore/draw/01-draw-offer.bru b/bruno/backcore/draw/01-draw-offer.bru new file mode 100644 index 0000000..087280a --- /dev/null +++ b/bruno/backcore/draw/01-draw-offer.bru @@ -0,0 +1,16 @@ +meta { + name: Draw offer + type: http + seq: 1 +} + +post { + url: {{baseUrl}}/api/board/game/{{gameId}}/draw/offer + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/draw/02-draw-accept.bru b/bruno/backcore/draw/02-draw-accept.bru new file mode 100644 index 0000000..9629ebd --- /dev/null +++ b/bruno/backcore/draw/02-draw-accept.bru @@ -0,0 +1,16 @@ +meta { + name: Draw accept + type: http + seq: 2 +} + +post { + url: {{baseUrl}}/api/board/game/{{gameId}}/draw/accept + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/draw/03-draw-decline.bru b/bruno/backcore/draw/03-draw-decline.bru new file mode 100644 index 0000000..a0535cd --- /dev/null +++ b/bruno/backcore/draw/03-draw-decline.bru @@ -0,0 +1,16 @@ +meta { + name: Draw decline + type: http + seq: 3 +} + +post { + url: {{baseUrl}}/api/board/game/{{gameId}}/draw/decline + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/draw/04-draw-claim.bru b/bruno/backcore/draw/04-draw-claim.bru new file mode 100644 index 0000000..950ee82 --- /dev/null +++ b/bruno/backcore/draw/04-draw-claim.bru @@ -0,0 +1,16 @@ +meta { + name: Draw claim fifty move + type: http + seq: 4 +} + +post { + url: {{baseUrl}}/api/board/game/{{gameId}}/draw/claim + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/export/01-export-fen.bru b/bruno/backcore/export/01-export-fen.bru new file mode 100644 index 0000000..bdd4dee --- /dev/null +++ b/bruno/backcore/export/01-export-fen.bru @@ -0,0 +1,16 @@ +meta { + name: Export FEN + type: http + seq: 1 +} + +get { + url: {{baseUrl}}/api/board/game/{{gameId}}/export/fen + body: none + auth: none +} + +headers { + Accept: text/plain +} + diff --git a/bruno/backcore/export/02-export-pgn.bru b/bruno/backcore/export/02-export-pgn.bru new file mode 100644 index 0000000..64935f1 --- /dev/null +++ b/bruno/backcore/export/02-export-pgn.bru @@ -0,0 +1,16 @@ +meta { + name: Export PGN + type: http + seq: 2 +} + +get { + url: {{baseUrl}}/api/board/game/{{gameId}}/export/pgn + body: none + auth: none +} + +headers { + Accept: application/x-chess-pgn +} + diff --git a/bruno/backcore/game/01-create-game.bru b/bruno/backcore/game/01-create-game.bru new file mode 100644 index 0000000..3248797 --- /dev/null +++ b/bruno/backcore/game/01-create-game.bru @@ -0,0 +1,30 @@ +meta { + name: Create game + type: http + seq: 1 +} + +post { + url: {{baseUrl}}/api/board/game + body: json + auth: none +} + +headers { + Accept: application/json + Content-Type: application/json +} + +body:json { + { + "white": { + "id": "player1", + "displayName": "Alice" + }, + "black": { + "id": "player2", + "displayName": "Bob" + } + } +} + diff --git a/bruno/backcore/game/02-get-game.bru b/bruno/backcore/game/02-get-game.bru new file mode 100644 index 0000000..644e8a1 --- /dev/null +++ b/bruno/backcore/game/02-get-game.bru @@ -0,0 +1,16 @@ +meta { + name: Get game + type: http + seq: 2 +} + +get { + url: {{baseUrl}}/api/board/game/{{gameId}} + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/game/03-stream-game.bru b/bruno/backcore/game/03-stream-game.bru new file mode 100644 index 0000000..59e50fe --- /dev/null +++ b/bruno/backcore/game/03-stream-game.bru @@ -0,0 +1,16 @@ +meta { + name: Stream game (NDJSON) + type: http + seq: 3 +} + +get { + url: {{baseUrl}}/api/board/game/{{gameId}}/stream + body: none + auth: none +} + +headers { + Accept: application/x-ndjson +} + diff --git a/bruno/backcore/game/04-resign-game.bru b/bruno/backcore/game/04-resign-game.bru new file mode 100644 index 0000000..8d689bb --- /dev/null +++ b/bruno/backcore/game/04-resign-game.bru @@ -0,0 +1,16 @@ +meta { + name: Resign game + type: http + seq: 4 +} + +post { + url: {{baseUrl}}/api/board/game/{{gameId}}/resign + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/import/01-import-fen.bru b/bruno/backcore/import/01-import-fen.bru new file mode 100644 index 0000000..35d94ee --- /dev/null +++ b/bruno/backcore/import/01-import-fen.bru @@ -0,0 +1,31 @@ +meta { + name: Import FEN + type: http + seq: 1 +} + +post { + url: {{baseUrl}}/api/board/game/import/fen + body: json + auth: none +} + +headers { + Accept: application/json + Content-Type: application/json +} + +body:json { + { + "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", + "white": { + "id": "player1", + "displayName": "Alice" + }, + "black": { + "id": "player2", + "displayName": "Bob" + } + } +} + diff --git a/bruno/backcore/import/02-import-pgn.bru b/bruno/backcore/import/02-import-pgn.bru new file mode 100644 index 0000000..99b0115 --- /dev/null +++ b/bruno/backcore/import/02-import-pgn.bru @@ -0,0 +1,23 @@ +meta { + name: Import PGN + type: http + seq: 2 +} + +post { + url: {{baseUrl}}/api/board/game/import/pgn + body: json + auth: none +} + +headers { + Accept: application/json + Content-Type: application/json +} + +body:json { + { + "pgn": "1. e4 e5 2. Nf3 Nc6 *" + } +} + diff --git a/bruno/backcore/move/01-make-move.bru b/bruno/backcore/move/01-make-move.bru new file mode 100644 index 0000000..4da1d6d --- /dev/null +++ b/bruno/backcore/move/01-make-move.bru @@ -0,0 +1,16 @@ +meta { + name: Make move + type: http + seq: 1 +} + +post { + url: {{baseUrl}}/api/board/game/{{gameId}}/move/{{uci}} + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/move/02-get-legal-moves.bru b/bruno/backcore/move/02-get-legal-moves.bru new file mode 100644 index 0000000..f66e3c1 --- /dev/null +++ b/bruno/backcore/move/02-get-legal-moves.bru @@ -0,0 +1,20 @@ +meta { + name: Get legal moves + type: http + seq: 2 +} + +get { + url: {{baseUrl}}/api/board/game/{{gameId}}/moves + body: none + auth: none +} + +params:query { + square: {{square}} +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/move/03-undo-move.bru b/bruno/backcore/move/03-undo-move.bru new file mode 100644 index 0000000..a622cfb --- /dev/null +++ b/bruno/backcore/move/03-undo-move.bru @@ -0,0 +1,16 @@ +meta { + name: Undo move + type: http + seq: 3 +} + +post { + url: {{baseUrl}}/api/board/game/{{gameId}}/undo + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/backcore/move/04-redo-move.bru b/bruno/backcore/move/04-redo-move.bru new file mode 100644 index 0000000..3c73adc --- /dev/null +++ b/bruno/backcore/move/04-redo-move.bru @@ -0,0 +1,16 @@ +meta { + name: Redo move + type: http + seq: 4 +} + +post { + url: {{baseUrl}}/api/board/game/{{gameId}}/redo + body: none + auth: none +} + +headers { + Accept: application/json +} + diff --git a/bruno/bruno.json b/bruno/bruno.json new file mode 100644 index 0000000..eee95b6 --- /dev/null +++ b/bruno/bruno.json @@ -0,0 +1,6 @@ +{ + "version": "1", + "name": "NowChessSystems", + "type": "collection" +} + diff --git a/bruno/environments/local.bru b/bruno/environments/local.bru new file mode 100644 index 0000000..85aff34 --- /dev/null +++ b/bruno/environments/local.bru @@ -0,0 +1,3 @@ +vars { + baseUrl: http://localhost:8080 +} diff --git a/modules/backcore/build.gradle.kts b/modules/backcore/build.gradle.kts index 3ce36b9..cb588bd 100644 --- a/modules/backcore/build.gradle.kts +++ b/modules/backcore/build.gradle.kts @@ -21,6 +21,14 @@ scoverage { scoverageVersion.set(versions["SCOVERAGE"]!!) } +configurations.scoverage { + resolutionStrategy.eachDependency { + if (requested.group == "org.scoverage" && requested.name.startsWith("scalac-scoverage-plugin_")) { + useTarget("${requested.group}:scalac-scoverage-plugin_2.13.16:2.3.0") + } + } +} + tasks.withType { scalaCompileOptions.additionalParameters = listOf("-encoding", "UTF-8") } @@ -131,4 +139,8 @@ tasks.jacocoTestReport { ) html.required.set(false) } + finalizedBy(tasks.reportScoverage) +} +tasks.reportScoverage { + dependsOn(tasks.test) }