DefaultYieldCurveDataProviderFn implements YieldCurveDataProviderFn { @Override public Result<YieldCurveData> retrieveYieldCurveData(Environment env, Currency currency) { IsdaYieldCurveDataId yieldCurveDataId = IsdaYieldCurveDataId.of(_yieldCurveDataName, currency); return env.getMarketDataBundle().get(yieldCurveDataId, YieldCurveData.class); } DefaultYieldCurveDataProviderFn(String yieldCurveDataName); @Override Result<YieldCurveData> retrieveYieldCurveData(Environment env, Currency currency);  }
@Test public void testFn() { Result<YieldCurveData> result = _fnWithUSDCurve.retrieveYieldCurveData(_env, Currency.USD); assertTrue("USD present in snapshot so should succeed.", result.isSuccess()); }
@Test public void testFnMissingData() { Result<YieldCurveData> result = _fnWithUSDCurve.retrieveYieldCurveData(_env, Currency.GBP); assertFalse("GBP is missing so result should be failure.", result.isSuccess()); }