trade.addAttribute("TA1", "C");
trade.addAttribute("TA2", "D");
trade.setDeal(new MockDeal("propOne", "propTwo"));
position.getTrades().add(trade);
PositionDocument doc = new PositionDocument();
doc.setPosition(position);
PositionDocument test = _posMaster.add(doc);
UniqueId uniqueId = test.getUniqueId();
assertNotNull(uniqueId);
assertEquals("DbPos", uniqueId.getScheme());
assertTrue(uniqueId.isVersioned());
assertTrue(Long.parseLong(uniqueId.getValue()) >= 1000);
assertEquals("0", uniqueId.getVersion());
assertEquals(now, test.getVersionFromInstant());
assertEquals(null, test.getVersionToInstant());
assertEquals(now, test.getCorrectionFromInstant());
assertEquals(null, test.getCorrectionToInstant());
ManageablePosition testPosition = test.getPosition();
assertNotNull(testPosition);
assertEquals(uniqueId, testPosition.getUniqueId());
assertEquals(BigDecimal.TEN, testPosition.getQuantity());
ExternalIdBundle secKey = testPosition.getSecurityLink().getExternalId();
assertEquals(1, secKey.size());