fix: Lints
Build & Test (NowChessSystems) TeamCity build finished

This commit is contained in:
2026-05-05 08:44:25 +02:00
parent 1813ea1d2d
commit dc224abe26
@@ -15,8 +15,10 @@ import java.util.Map as JMap
class InternalAuthEnabledProfile extends QuarkusTestProfile: class InternalAuthEnabledProfile extends QuarkusTestProfile:
override def getConfigOverrides(): JMap[String, String] = override def getConfigOverrides(): JMap[String, String] =
JMap.of( JMap.of(
"nowchess.internal.auth.enabled", "true", "nowchess.internal.auth.enabled",
"nowchess.internal.secret", "test-secret-123", "true",
"nowchess.internal.secret",
"test-secret-123",
) )
@QuarkusTest @QuarkusTest
@@ -36,32 +38,35 @@ class InternalAuthFilterHttpTest:
@Test @Test
@DisplayName("POST /api/board/game without secret returns 401") @DisplayName("POST /api/board/game without secret returns 401")
def rejectNoSecret(): Unit = def rejectNoSecret(): Unit =
RestAssured.`given`() RestAssured
.`given`()
.contentType(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)
.body("{}") .body("{}")
.when() .when()
.post("/api/board/game") .post("/api/board/game")
.`then`() .`then`()
.statusCode(401) .statusCode(401)
@Test @Test
@DisplayName("POST /api/board/game with wrong secret returns 401") @DisplayName("POST /api/board/game with wrong secret returns 401")
def rejectWrongSecret(): Unit = def rejectWrongSecret(): Unit =
RestAssured.`given`() RestAssured
.`given`()
.contentType(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)
.header("X-Internal-Secret", "wrong-secret") .header("X-Internal-Secret", "wrong-secret")
.body("{}") .body("{}")
.when() .when()
.post("/api/board/game") .post("/api/board/game")
.`then`() .`then`()
.statusCode(401) .statusCode(401)
@Test @Test
@DisplayName("GET /api/board/game/{id} without secret returns 404 not 401") @DisplayName("GET /api/board/game/{id} without secret returns 404 not 401")
def nonInternalEndpointNotBlocked(): Unit = def nonInternalEndpointNotBlocked(): Unit =
RestAssured.`given`() RestAssured
.when() .`given`()
.when()
.get("/api/board/game/nonexistent") .get("/api/board/game/nonexistent")
.`then`() .`then`()
.statusCode(404) .statusCode(404)
// scalafix:on // scalafix:on