ScenarioDataBuilder { public ScenarioDataBuilder addSecurityMarketValue(String scenarioId, Security security, double marketValue) { builder(scenarioId).add(SecurityId.of(security), marketValue); return this; }  ScenarioDataBuilder addMulticurve(String scenarioId, String name, MulticurveBundle multicurve); ScenarioDataBuilder addFxRate(String scenarioId, CurrencyPair currencyPair, double rate); ScenarioDataBuilder addSecurityMarketValue(String scenarioId, Security security, double marketValue); ScenarioDataBuilder addSecurityValue(String scenarioId, Security security, FieldName fieldName, double value); ScenarioDataBuilder addSecurityValue(String scenarioId, Security security, FieldName fieldName, Object value); ScenarioDataBuilder valuationTime(String scenarioId, ZonedDateTime valuationTime); ScenarioMarketDataEnvironment build();  }
@Test public void addSecurityMarketValue() { Security security = new SimpleSecurity(UniqueId.parse("test~123"), ExternalId.parse("ex~123").toBundle(), "TEST", "test security"); ScenarioMarketDataEnvironment env = new ScenarioDataBuilder() .addSecurityMarketValue("1", security, 1d) .addSecurityMarketValue("2", security, 2d) .addSecurityMarketValue("3", security, 3d) .valuationTime("1", ZonedDateTime.now()) .valuationTime("2", ZonedDateTime.now()) .valuationTime("3", ZonedDateTime.now()) .build(); SingleValueRequirement req = SingleValueRequirement.of(SecurityId.of(security)); assertEquals(1d, env.getData().get("1").getData().get(req)); assertEquals(2d, env.getData().get("2").getData().get(req)); assertEquals(3d, env.getData().get("3").getData().get(req)); }