@Test public void tournamentTableShouldNotRetrievePlayersMainAccount() { table.setShowInLobby(false); table.setGameId(1l); host = gameHost(new InMemoryGameRepository(gameRules)); BigDecimal playerId = BigDecimal.valueOf(54321); CommandWrapper aCommand = new CommandWrapper(table.getTableId(), 1l, playerId, SESSION_ID, "aCommand"); aCommand.setRequestId(UUID); when(playerRepository.findSummaryByPlayerAndSession(playerId, SESSION_ID)) .thenReturn( aPlayerSessionSummary(playerId, "", BigDecimal.valueOf(10), BigDecimal.valueOf(100))); List<HostDocument> documents = host.execute(table, aCommand); assertEquals(1, documents.size()); assertThat((ErrorHostDocument) documents.get(0), Matchers.isA(ErrorHostDocument.class)); }
private List<HostDocument> executeCommand() { host = gameHost(new InMemoryGameRepository(gameRules)); return host.execute(table, command); }