From 26f3154cda51add256bb9c4f65c9b70abd52d5f1 Mon Sep 17 00:00:00 2001 From: LQ63 Date: Wed, 22 Apr 2026 00:02:02 +0200 Subject: [PATCH] fix(core): core dependecy to rules small fixes --- .../chess/json/SquareDeserializer.scala | 2 -- .../chess/registry/GameRegistryImplTest.scala | 21 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/modules/core/src/main/scala/de/nowchess/chess/json/SquareDeserializer.scala b/modules/core/src/main/scala/de/nowchess/chess/json/SquareDeserializer.scala index a14b84f..5641a8f 100644 --- a/modules/core/src/main/scala/de/nowchess/chess/json/SquareDeserializer.scala +++ b/modules/core/src/main/scala/de/nowchess/chess/json/SquareDeserializer.scala @@ -5,7 +5,5 @@ import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer} import de.nowchess.api.board.Square class SquareDeserializer extends JsonDeserializer[Square]: - // scalafix:off DisableSyntax.null override def deserialize(p: JsonParser, ctx: DeserializationContext): Square = Square.fromAlgebraic(p.getText).orNull - // scalafix:on DisableSyntax.null diff --git a/modules/core/src/test/scala/de/nowchess/chess/registry/GameRegistryImplTest.scala b/modules/core/src/test/scala/de/nowchess/chess/registry/GameRegistryImplTest.scala index f027e53..53d1362 100644 --- a/modules/core/src/test/scala/de/nowchess/chess/registry/GameRegistryImplTest.scala +++ b/modules/core/src/test/scala/de/nowchess/chess/registry/GameRegistryImplTest.scala @@ -21,14 +21,24 @@ class GameRegistryImplTest: @Test @DisplayName("store saves entry") def testStore(): Unit = - val entry = GameEntry("g1", GameEngine(ruleSet = DefaultRules), PlayerInfo(PlayerId("p1"), "P1"), PlayerInfo(PlayerId("p2"), "P2")) + val entry = GameEntry( + "g1", + GameEngine(ruleSet = DefaultRules), + PlayerInfo(PlayerId("p1"), "P1"), + PlayerInfo(PlayerId("p2"), "P2"), + ) registry.store(entry) assertTrue(registry.get("g1").isDefined) @Test @DisplayName("get returns stored entry") def testGet(): Unit = - val entry = GameEntry("g2", GameEngine(ruleSet = DefaultRules), PlayerInfo(PlayerId("p1"), "P1"), PlayerInfo(PlayerId("p2"), "P2")) + val entry = GameEntry( + "g2", + GameEngine(ruleSet = DefaultRules), + PlayerInfo(PlayerId("p1"), "P1"), + PlayerInfo(PlayerId("p2"), "P2"), + ) registry.store(entry) val retrieved = registry.get("g2") assertTrue(retrieved.isDefined) @@ -42,7 +52,12 @@ class GameRegistryImplTest: @Test @DisplayName("update modifies existing entry") def testUpdate(): Unit = - val entry = GameEntry("g3", GameEngine(ruleSet = DefaultRules), PlayerInfo(PlayerId("p1"), "P1"), PlayerInfo(PlayerId("p2"), "P2")) + val entry = GameEntry( + "g3", + GameEngine(ruleSet = DefaultRules), + PlayerInfo(PlayerId("p1"), "P1"), + PlayerInfo(PlayerId("p2"), "P2"), + ) registry.store(entry) val updated = entry.copy(resigned = true) registry.update(updated)