@Test public void anAsyncTransferIsTriggeredWhenWeTransferFromThePlayersAccount() throws GameException, WalletServiceException { underTest.forPlayer(GAME_PLAYER).decreaseBalanceBy(AMOUNT, AUDIT_LABEL, REFERENCE); verify(gameHostWallet) .post( TABLE_ID, GAME_ID, playerInfo, BigDecimal.ZERO.subtract(AMOUNT), TransactionType.Stake, AUDIT_LABEL, REFERENCE, NEW_UUID); }
@SuppressWarnings({"ThrowableInstanceNeverThrown"}) @Test(expected = GameException.class) public void failedTransferFromThePlayerShouldThrowAGameException() throws WalletServiceException, GameException { doThrow(new WalletServiceException("aTestException")) .when(gameHostWallet) .post( TABLE_ID, GAME_ID, playerInfo, BigDecimal.ZERO.subtract(AMOUNT), TransactionType.Stake, AUDIT_LABEL, REFERENCE, NEW_UUID); underTest.forPlayer(GAME_PLAYER).decreaseBalanceBy(AMOUNT, AUDIT_LABEL, REFERENCE); }