diff --git a/application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/StartGameUseCase.kt b/application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/StartGameUseCase.kt index 9dcc0f8f..a6f0e921 100644 --- a/application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/StartGameUseCase.kt +++ b/application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/StartGameUseCase.kt @@ -68,7 +68,7 @@ class StartGameUseCase( throw PlatformException(GAME_START_FAILED, "Room Id is null") } val gameServerHost = game.backEndUrl - val startGameRequest = StartGameRequest(roomId.toString(), players.map { it.toGamePlayer() }) + val startGameRequest = StartGameRequest(roomId!!.value, players.map { it.toGamePlayer() }) val startGameResponse = gameService.startGame(gameServerHost, jwtToken, startGameRequest) return StartedGameEvent(GAME_STARTED, Data(startGameResponse.url, roomId!!)) diff --git a/spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt b/spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt index 14f5d314..fb2d09be 100644 --- a/spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt +++ b/spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/RoomControllerTest.kt @@ -781,7 +781,7 @@ class RoomControllerTest @Autowired constructor( mockMvc.perform( post("/rooms/${room.roomId!!.value}:startGame") .withJwt(toJwt()) - .withJson(StartGameRequest(room.players.map { it.toGamePlayer() })) + .withJson(StartGameRequest(room.roomId!!.value,room.players.map { it.toGamePlayer() })) ) private fun Player.toGamePlayer(): StartGameRequest.GamePlayer =