@Test public void testProcessTransactionResultCorrectlyCallsAuditOnSuccessWithNonNullExecutionResult() throws com.yazino.game.api.GameException { final String auditLabel = "test424243542354"; gameStatus = mock(com.yazino.game.api.GameStatus.class); when(gameRules.canBeClosed(gameStatus)).thenReturn(false); when(gameRules.isComplete(gameStatus)).thenReturn(false); whenPlayers(); when(gameRules.getPlayerInformation(gameStatus)) .thenReturn(Collections.<com.yazino.game.api.PlayerAtTableInformation>emptyList()); when(gameRules.getNumberOfSeatsTaken(gameStatus)).thenReturn(0); table.setCurrentGame(gameStatus); table.setGameId(GAME_ID); final com.yazino.game.api.TransactionResult txResult = new com.yazino.game.api.TransactionResult("foo", true, null, null, null, null); final com.yazino.game.api.ExecutionResult executionResult = new com.yazino.game.api.ExecutionResult.Builder(gameRules, gameStatus).build(); when(gameRules.processTransactionResult( isA(com.yazino.game.api.ExecutionContext.class), eq(txResult))) .thenReturn(executionResult); auditor = mock(Auditor.class); when(auditor.newLabel()).thenReturn(auditLabel); host = gameHost(new InMemoryGameRepository(gameRules)); host.processTransactionResult(table, GAME_ID, txResult); }