Skip to content

Commit

Permalink
Merge pull request #31 from Gamify-IT/maintenance/fix-new-sonar-issues
Browse files Browse the repository at this point in the history
fix new sonar issues
  • Loading branch information
Gr33ndev authored Apr 26, 2023
2 parents c01e27c + 5a62d70 commit cdbc13b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ private void handleDeveloperJoined() {
simpMessagingTemplate.convertAndSend(WebsocketListener.DEVELOPER_TOPIC, developerMessageWrapped);
try {
Thread.sleep(1000);
} catch (final Exception e) {
throw new RuntimeException(e); //NOSONAR
} catch (final Exception e) { //NOSONAR
throw new RuntimeException(e);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ private void saveAndDeleteGame(final Game game) {
private void sleep(final int sleepTime){
try {
Thread.sleep(sleepTime);
} catch (final InterruptedException e) {
} catch (final InterruptedException e) { //NOSONAR
log.error("could not sleep {} seconds. Error: {}", sleepTime, e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void getLobby() {
final Lobby result = lobbyManagerService.getLobby(TEST_LOBBY_NAME);

// evaluate
assertEquals(result.getLobbyName(), TEST_LOBBY_NAME);
assertEquals(TEST_LOBBY_NAME, result.getLobbyName());
}

@Test
Expand All @@ -73,7 +73,7 @@ void addPlayer() {
lobbyManagerService.addPlayer(TEST_LOBBY_NAME, player);

// evaluate
assertEquals(lobby.getPlayers().size(), 1);
assertEquals(1, lobby.getPlayers().size());
assertTrue(lobby.getPlayers().contains(player));
}

Expand All @@ -88,7 +88,7 @@ void getLobbyFromPlayer() {
final String result = lobbyManagerService.getLobbyFromPlayer(player.getKey());

// evaluate
assertEquals(result, TEST_LOBBY_NAME);
assertEquals(TEST_LOBBY_NAME, result);
}

@Test
Expand Down Expand Up @@ -185,7 +185,7 @@ void getLobbies() {
final List<Lobby> result = lobbyManagerService.getLobbies();

// evaluate
assertEquals(result.get(0).getLobbyName(), TEST_LOBBY_NAME);
assertEquals(TEST_LOBBY_NAME, result.get(0).getLobbyName());
}

@Test
Expand All @@ -204,4 +204,4 @@ void startGame() {
// evaluate
assertTrue(lobbyManagerService.getLobby(TEST_LOBBY_NAME).isStarted());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class WebsocketServiceTest {
class WebsocketServiceTest {
private WebsocketService websocketService;

@BeforeEach
Expand Down

0 comments on commit cdbc13b

Please sign in to comment.