Skip to content

Commit

Permalink
finos#1025 updated basket send to market test to include taking off t…
Browse files Browse the repository at this point in the history
…he market
  • Loading branch information
naleeha committed Dec 5, 2023
1 parent b898042 commit dc35263
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,20 @@ class BasketSendToMarketTest extends VuuServerTestCase {
val basketTradeInstanceId = BasketTradeId.current

val vpBasketTrading = vuuServer.createViewPort(BasketModule.NAME, BasketTradingTable)
val vpBasketTradingCons = vuuServer.createViewPort(BasketModule.NAME, BasketTradingConstituentTable)

vuuServer.runOnce()

And("Check the trading constituents are created")
assertVpEq(combineQsForVp(vpBasketTradingCons)) {
Table(
("quantity", "side", "instanceId", "instanceIdRic", "basketId", "ric", "description", "notionalUsd", "notionalLocal", "venue", "algo", "algoParams", "pctFilled", "weighting", "priceSpread", "limitPrice", "priceStrategyId", "filledQty", "orderStatus"),
(10L, "Buy", basketTradeInstanceId, s"$basketTradeInstanceId.BP.L", ".FTSE", "BP.L", "Beyond Petroleum", null, null, null, -1, null, null, 0.1, null, null, 2, 0, "PENDING"),
(10L, "Sell", basketTradeInstanceId, s"$basketTradeInstanceId.BT.L", ".FTSE", "BT.L", "British Telecom", null, null, null, -1, null, null, 0.1, null, null, 2, 0, "PENDING"),
(10L, "Buy", basketTradeInstanceId, s"$basketTradeInstanceId.VOD.L", ".FTSE", "VOD.L", "Vodafone", null, null, null, -1, null, null, 0.1, null, null, 2, 0, "PENDING")
)
}

val tradingService = vuuServer.getViewPortRpcServiceProxy[BasketTradingServiceIF](vpBasketTrading)

And("send the basket to market")
Expand All @@ -71,6 +82,19 @@ class BasketSendToMarketTest extends VuuServerTestCase {
(basketTradeInstanceId, ".FTSE", "TestBasket", "ON_MARKET", 1, null, null, null, null, "Buy")
)
}

Then("Take the basket off the market")
tradingService.takeOffMarket(basketTradeInstanceId)(vuuServer.requestContext)

vuuServer.runOnce()

And("verify basket is on market")
assertVpEq(combineQsForVp(vpBasketTrading)) {
Table(
("instanceId", "basketId", "basketName", "status", "units", "filledPct", "fxRateToUsd", "totalNotional", "totalNotionalUsd", "side"),
(basketTradeInstanceId, ".FTSE", "TestBasket", "OFF_MARKET", 1, null, null, null, null, "Buy")
)
}
}
}
}
Expand Down

0 comments on commit dc35263

Please sign in to comment.