* node has a position in a different security of the same type
*/
@Test
public void addTradeNoExistingPosition() {
UniqueId tradeId = _tradeBuilder.addTrade(createTradeData("INTC US Equity", null), _savedNode.getUniqueId());
ManageableTrade testTrade = _positionMaster.getTrade(tradeId);
assertEquals(LocalDate.of(2012, 12, 21), testTrade.getTradeDate());
assertEquals(OffsetTime.of(LocalTime.of(14, 25), ZoneOffset.UTC), testTrade.getTradeTime());
assertEquals(INTEL_BUNDLE, testTrade.getSecurityLink().getExternalId());
assertEquals(1234d, testTrade.getPremium());
assertEquals(Currency.USD, testTrade.getPremiumCurrency());
assertEquals(LocalDate.of(2012, 12, 22), testTrade.getPremiumDate());
assertEquals(OffsetTime.of(LocalTime.of(13, 30), ZoneOffset.UTC), testTrade.getPremiumTime());
assertEquals(BigDecimal.valueOf(30), testTrade.getQuantity());
assertEquals(ExternalId.of(AbstractTradeBuilder.CPTY_SCHEME, "cptyName"), testTrade.getCounterpartyExternalId());
assertTrue(testTrade.getAttributes().isEmpty());
ManageablePosition testPosition = _positionMaster.get(testTrade.getParentPositionId()).getPosition();
assertEquals(INTEL_BUNDLE, testPosition.getSecurityLink().getExternalId());
assertEquals(testTrade.getQuantity(), testPosition.getQuantity());
assertEquals(1, testPosition.getTrades().size());
assertEquals(testTrade, testPosition.getTrades().get(0));
ManageablePortfolio testPortfolio = _portfolioMaster.get(_savedNode.getPortfolioId()).getPortfolio();
ManageablePortfolioNode testNode = testPortfolio.getRootNode().getChildNodes().get(0);