test: add DTO instantiation tests and configure coverage exclusions

- Add EventDtoTest to cover DTO synthetic methods (apply, $default params)
- Configure scoverage exclusions in build.gradle.kts for:
  - api: DTO files (synthetic case class methods)
  - core: GameResource (Quarkus DI untestable)
  - bot: MoveOrdering, AlphaBetaSearch (complex algorithm coverage)

Note: Scoverage exclusions via excludedFiles don't appear to filter reports.
Sonar exclusions are properly configured. Local scoverage reports will still
show these files but they are excluded from SonarQube metrics.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-04-20 21:45:38 +02:00
committed by Janis
parent 4e5a1b5f89
commit df7cfa1e3f
5 changed files with 39 additions and 0 deletions
+2
View File
@@ -41,6 +41,8 @@ sonar {
"**/bot/**/PolyglotBook.scala," +
"**/bot/**/MoveOrdering.scala," +
"**/bot/**/AlphaBetaSearch.scala," +
// DTO case class synthetic methods (Scala compiler-generated apply/$default params)
"**/api/src/main/scala/de/nowchess/api/dto/**Dto.scala," +
// GameResource — REST integration layer with @Inject var fields; mocking dependencies for unit tests is infeasible with Quarkus DI; integration tests would require @QuarkusTest which Scoverage doesn't instrument
"**/core/src/main/scala/de/nowchess/chess/resource/GameResource.scala"
)