From 9fc9f824532c84f43304309ab44518cded572831 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 24 Sep 2022 23:52:47 +0200 Subject: [PATCH] Address codacy complains --- src/main/resources/theme/progress.css | 53 ++++++++++--------- .../client/game/GameServiceTest.java | 4 +- .../game/IsReadyForGameControllerTest.java | 7 --- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/main/resources/theme/progress.css b/src/main/resources/theme/progress.css index 685aee0f1a..0c04090b2c 100644 --- a/src/main/resources/theme/progress.css +++ b/src/main/resources/theme/progress.css @@ -1,37 +1,42 @@ -.circleindicator-container { - circleindicator-color: -fx-accent; - -fx-padding: 5.0; - -fx-background-color: -fx-background; +.circleindicator-container { + circleindicator-color: -fx-accent; + -fx-padding: 5.0; + -fx-background-color: -fx-background; } + .circleindicator-container > .circleindicator-label { - -fx-font-weight: bold; - -fx-font-size: 2.5em; - -fx-text-fill: circleindicator-color; - -fx-padding: 5.0; + -fx-font-weight: bold; + -fx-font-size: 2.5em; + -fx-text-fill: circleindicator-color; + -fx-padding: 5.0; } -.ringindicator{ - -fx-ring-width: 22.0; - -fx-inner-radius: 60.0; +.ringindicator { + -fx-ring-width: 22.0; + -fx-inner-radius: 60.0; } + .ringindicator-inner-circle { - -fx-opacity: 0.55; - -fx-stroke: circleindicator-color; - -fx-stroke-width: 8.0px; - -fx-fill: -fx-background; + -fx-opacity: 0.55; + -fx-stroke: circleindicator-color; + -fx-stroke-width: 8.0px; + -fx-fill: -fx-background; } + .ringindicator-filler { - -fx-stroke: circleindicator-color; - -fx-fill: -fx-background; - -fx-stroke-line-cap: butt; + -fx-stroke: circleindicator-color; + -fx-fill: -fx-background; + -fx-stroke-line-cap: butt; } + .ringindicator-outer-circle-secondary { - -fx-opacity: 0.1; - -fx-stroke: circleindicator-color; - -fx-stroke-width: 2.0px; - -fx-fill: -fx-background; + -fx-opacity: 0.1; + -fx-stroke: circleindicator-color; + -fx-stroke-width: 2.0px; + -fx-fill: -fx-background; } + .indeterminate { - -fx-opacity: 0.55; - -fx-stroke: linear-gradient(from 0.0% 0.0% to 70.0% 70.0%, circleindicator-color 70.0%, white 75.0%, white); + -fx-opacity: 0.55; + -fx-stroke: linear-gradient(from 0.0% 0.0% to 70.0% 70.0%, circleindicator-color 70.0%, white 75.0%, white); } \ No newline at end of file diff --git a/src/test/java/com/faforever/client/game/GameServiceTest.java b/src/test/java/com/faforever/client/game/GameServiceTest.java index 9685c31287..a80ae0251e 100644 --- a/src/test/java/com/faforever/client/game/GameServiceTest.java +++ b/src/test/java/com/faforever/client/game/GameServiceTest.java @@ -799,7 +799,7 @@ public void startSearchMatchmakerThenCancelledWithGame() throws IOException { when(leaderboardService.getActiveLeagueEntryForPlayer(junitPlayer, "global")).thenReturn(completedFuture(Optional.empty())); when(gameUpdater.update(any(), any(), any(), any())).thenReturn(completedFuture(null)); when(mapService.download(gameLaunchMessage.getMapName())).thenReturn(completedFuture(null)); - when(fafServerAccessor.getGameLaunchMessage()).thenReturn(CompletableFuture.completedFuture(gameLaunchMessage)); + when(fafServerAccessor.getGameLaunchMessage()).thenReturn(completedFuture(gameLaunchMessage)); CompletableFuture future = instance.startSearchMatchmaker(); when(process.isAlive()).thenReturn(true); future.cancel(false); @@ -821,7 +821,7 @@ public void startSearchMatchmakerThenCancelledNoGame() throws IOException { mockStartGameProcess(gameMapper.map(gameLaunchMessage)); when(gameUpdater.update(any(), any(), any(), any())).thenReturn(completedFuture(null)); when(mapService.download(gameLaunchMessage.getMapName())).thenReturn(completedFuture(null)); - when(fafServerAccessor.getGameLaunchMessage()).thenReturn(CompletableFuture.completedFuture(gameLaunchMessage)); + when(fafServerAccessor.getGameLaunchMessage()).thenReturn(completedFuture(gameLaunchMessage)); instance.startSearchMatchmaker().cancel(false); verify(notificationService, never()).addServerNotification(any()); } diff --git a/src/test/java/com/faforever/client/tournament/game/IsReadyForGameControllerTest.java b/src/test/java/com/faforever/client/tournament/game/IsReadyForGameControllerTest.java index 8475cfb1fe..8a44a487a0 100644 --- a/src/test/java/com/faforever/client/tournament/game/IsReadyForGameControllerTest.java +++ b/src/test/java/com/faforever/client/tournament/game/IsReadyForGameControllerTest.java @@ -24,13 +24,6 @@ public void setUp() throws Exception { loadFxml("theme/tournaments/is_ready_for_game.fxml", clazz -> instance); } - @Test - public void testInitialization(){ - instance.setTimeout(1); - instance.setDismissCallBack(() -> {}); - instance.setReadyCallback(() -> {}); - } - @Test public void testTimeOut() { AtomicBoolean dismissCalled = new AtomicBoolean(false);