assertEquals("V1", testResult.getAttributes().get("A1"));
assertEquals("V2", testResult.getAttributes().get("A2"));
}
public void test_getPortfolio_UniqueId_instants_children() throws Exception {
PortfolioMaster mockPortfolio = mock(PortfolioMaster.class);
PositionMaster mockPosition = mock(PositionMaster.class);
ManageablePortfolioNode manNode = example(true);
ManageablePortfolio manPrt = new ManageablePortfolio("Hello", manNode);
manPrt.setUniqueId(UID);
PortfolioDocument prtDoc = new PortfolioDocument(manPrt);
ManageableTrade manTrade = new ManageableTrade();
manTrade.setQuantity(BigDecimal.valueOf(1234));
manTrade.setSecurityLink(new ManageableSecurityLink(ExternalId.of("CC", "DD")));
manTrade.setUniqueId(UID5);
ManageablePosition manPos = new ManageablePosition();
manPos.setQuantity(BigDecimal.valueOf(1235));
manPos.setSecurityLink(new ManageableSecurityLink(ExternalId.of("AA", "BB")));
manPos.setUniqueId(UID4);
manPos.addTrade(manTrade);
PositionDocument posDoc = new PositionDocument(manPos);
PositionSearchRequest posRequest = new PositionSearchRequest();
posRequest.addPositionObjectId(UID4);
posRequest.setVersionCorrection(VC);
PositionSearchResult posResult = new PositionSearchResult();
posResult.getDocuments().add(posDoc);
when(mockPortfolio.get(UID)).thenReturn(prtDoc);
when(mockPosition.search(posRequest)).thenReturn(posResult);
MasterPositionSource test = new MasterPositionSource(mockPortfolio, mockPosition);
Portfolio testResult = test.getPortfolio(UID, VC);
verify(mockPortfolio, times(1)).get(UID);
verify(mockPosition, times(1)).search(posRequest);