diff options
Diffstat (limited to 'sw-server/src')
12 files changed, 10 insertions, 35 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/TopicSubscriptionInterceptor.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/TopicSubscriptionInterceptor.kt index 5f298633..d8181f8a 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/TopicSubscriptionInterceptor.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/TopicSubscriptionInterceptor.kt @@ -2,7 +2,6 @@ package org.luxons.sevenwonders.server.config import org.luxons.sevenwonders.server.validation.DestinationAccessValidator import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired import org.springframework.messaging.Message import org.springframework.messaging.MessageChannel import org.springframework.messaging.simp.stomp.StompCommand diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt index 21eb7cc8..dd4c4b15 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt @@ -1,7 +1,6 @@ package org.luxons.sevenwonders.server.config import org.luxons.sevenwonders.model.api.SEVEN_WONDERS_WS_ENDPOINT -import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.messaging.simp.config.ChannelRegistration diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameBrowserController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameBrowserController.kt index 48928632..a0928b45 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameBrowserController.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameBrowserController.kt @@ -10,7 +10,6 @@ import org.luxons.sevenwonders.server.lobby.Lobby import org.luxons.sevenwonders.server.repositories.LobbyRepository import org.luxons.sevenwonders.server.repositories.PlayerRepository import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired import org.springframework.messaging.handler.annotation.MessageMapping import org.springframework.messaging.simp.SimpMessagingTemplate import org.springframework.messaging.simp.annotation.SendToUser diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt index 2a253136..dc5dffdb 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt @@ -10,7 +10,6 @@ import org.luxons.sevenwonders.server.api.toDTO import org.luxons.sevenwonders.server.lobby.Player import org.luxons.sevenwonders.server.repositories.PlayerRepository import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired import org.springframework.messaging.handler.annotation.MessageMapping import org.springframework.messaging.simp.SimpMessagingTemplate import org.springframework.messaging.simp.annotation.SendToUser diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/HomeController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/HomeController.kt index cfc6b58f..4a9fe0a2 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/HomeController.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/HomeController.kt @@ -6,7 +6,6 @@ import org.luxons.sevenwonders.model.api.PlayerDTO import org.luxons.sevenwonders.model.api.actions.ChooseNameAction import org.luxons.sevenwonders.server.repositories.PlayerRepository import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired import org.springframework.messaging.handler.annotation.MessageMapping import org.springframework.messaging.simp.annotation.SendToUser import org.springframework.stereotype.Controller diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt index 5005d6c9..fafcf7c3 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt @@ -1,5 +1,7 @@ package org.luxons.sevenwonders.server.controllers +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import org.hildan.livedoc.core.annotations.Api import org.luxons.sevenwonders.bot.SevenWondersBot import org.luxons.sevenwonders.model.api.actions.AddBotAction @@ -12,15 +14,12 @@ import org.luxons.sevenwonders.server.lobby.Player import org.luxons.sevenwonders.server.repositories.LobbyRepository import org.luxons.sevenwonders.server.repositories.PlayerRepository import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired +import org.springframework.beans.factory.annotation.Value import org.springframework.messaging.handler.annotation.MessageMapping import org.springframework.messaging.simp.SimpMessagingTemplate import org.springframework.stereotype.Controller import org.springframework.validation.annotation.Validated import java.security.Principal -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import org.springframework.beans.factory.annotation.Value /** * Handles actions in the game's lobby. The lobby is the place where players gather before a game. diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepository.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepository.kt index 6c69b6d5..06afc78c 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepository.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepository.kt @@ -3,7 +3,6 @@ package org.luxons.sevenwonders.server.repositories import org.luxons.sevenwonders.engine.data.GameDefinition import org.luxons.sevenwonders.server.lobby.Lobby import org.luxons.sevenwonders.server.lobby.Player -import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Repository import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicLong diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/validation/DestinationAccessValidator.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/validation/DestinationAccessValidator.kt index 4f6b6a6d..e680f094 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/validation/DestinationAccessValidator.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/validation/DestinationAccessValidator.kt @@ -1,7 +1,6 @@ package org.luxons.sevenwonders.server.validation import org.luxons.sevenwonders.server.repositories.LobbyRepository -import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Component import java.util.regex.Pattern diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/LobbyControllerTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/LobbyControllerTest.kt index 31a3c9c9..9aa1ef0e 100644 --- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/LobbyControllerTest.kt +++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/LobbyControllerTest.kt @@ -2,25 +2,21 @@ package org.luxons.sevenwonders.server.controllers import org.junit.Before import org.junit.Test -import org.luxons.sevenwonders.model.api.actions.ReorderPlayersAction -import org.luxons.sevenwonders.model.api.actions.UpdateSettingsAction import org.luxons.sevenwonders.model.CustomizableSettings import org.luxons.sevenwonders.model.WonderSidePickMethod.ALL_A +import org.luxons.sevenwonders.model.api.State +import org.luxons.sevenwonders.model.api.actions.ReorderPlayersAction +import org.luxons.sevenwonders.model.api.actions.UpdateSettingsAction import org.luxons.sevenwonders.server.lobby.Lobby import org.luxons.sevenwonders.server.lobby.Player import org.luxons.sevenwonders.server.lobby.PlayerIsNotOwnerException import org.luxons.sevenwonders.server.lobby.PlayerNotInLobbyException -import org.luxons.sevenwonders.model.api.State import org.luxons.sevenwonders.server.repositories.LobbyRepository import org.luxons.sevenwonders.server.repositories.PlayerNotFoundException import org.luxons.sevenwonders.server.repositories.PlayerRepository import org.luxons.sevenwonders.server.test.mockSimpMessagingTemplate import java.util.HashMap -import kotlin.test.assertEquals -import kotlin.test.assertFailsWith -import kotlin.test.assertFalse -import kotlin.test.assertSame -import kotlin.test.assertTrue +import kotlin.test.* class LobbyControllerTest { diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt index 80f5e866..094fe7de 100644 --- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt +++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt @@ -17,12 +17,7 @@ import org.luxons.sevenwonders.server.lobby.Lobby.PlayerNameAlreadyUsedException import org.luxons.sevenwonders.server.lobby.Lobby.PlayerOverflowException import org.luxons.sevenwonders.server.lobby.Lobby.PlayerUnderflowException import org.luxons.sevenwonders.server.lobby.Lobby.UnknownPlayerException -import kotlin.test.assertEquals -import kotlin.test.assertFailsWith -import kotlin.test.assertFalse -import kotlin.test.assertNotNull -import kotlin.test.assertSame -import kotlin.test.assertTrue +import kotlin.test.* @RunWith(Theories::class) class LobbyTest { diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt index c59dc49f..898a56fc 100644 --- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt +++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt @@ -3,11 +3,7 @@ package org.luxons.sevenwonders.server.repositories import org.junit.Before import org.junit.Test import org.luxons.sevenwonders.server.lobby.Player -import kotlin.test.assertFailsWith -import kotlin.test.assertNotNull -import kotlin.test.assertSame -import kotlin.test.assertTrue -import kotlin.test.fail +import kotlin.test.* class LobbyRepositoryTest { diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt index fc016903..b5c849a7 100644 --- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt +++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt @@ -2,11 +2,7 @@ package org.luxons.sevenwonders.server.repositories import org.junit.Before import org.junit.Test -import kotlin.test.assertEquals -import kotlin.test.assertFailsWith -import kotlin.test.assertFalse -import kotlin.test.assertSame -import kotlin.test.assertTrue +import kotlin.test.* class PlayerRepositoryTest { |