assertEquals(res2.getProperty("FundingCurve"), "DefaultFunding");
assertEquals(res2.getProperty("Currency"), "USD");
}
public void testTradeSpecificOverride() {
final DependencyGraphBuilder builder = createBuilder();
final ViewCalculationConfiguration config = builder.getCompilationContext().getViewCalculationConfiguration();
final PositionSource positions = builder.getCompilationContext().getPortfolioStructure().getPositionSource();
final Trade trade1 = getTrade(positions, "TradeAttr");
config.setDefaultProperties(ValueProperties.with("TRADE.Present Value.DEFAULT_ForwardCurve", "GenericForward").with("TRADE.*.DEFAULT_FundingCurve", "GenericFunding")
.with("TRADE.*.DEFAULT_ForwardCurve." + trade1.getUniqueId(), "BarForward").with("TRADE.Present Value.DEFAULT_FundingCurve." + trade1.getUniqueId(), "BarFunding").get());
final ValueRequirement req1 = createValueRequirement(ComputationTargetSpecification.of(trade1), ValueProperties.none());
final ValueRequirement req2 = createValueRequirement(ComputationTargetSpecification.of(getTrade(positions, "Trade")), ValueProperties.none());
builder.addTarget(req1);
builder.addTarget(req2);
builder.getDependencyGraph();
final ValueSpecification res1 = builder.getValueRequirementMapping().get(req1);
final ValueSpecification res2 = builder.getValueRequirementMapping().get(req2);
assertEquals(res1.getProperty("ForwardCurve"), "BarForward");
assertEquals(res1.getProperty("FundingCurve"), "BarFunding");
assertEquals(res1.getProperty("Currency"), "USD");
assertEquals(res2.getProperty("ForwardCurve"), "GenericForward");
assertEquals(res2.getProperty("FundingCurve"), "GenericFunding");