DefaultCreditCurveDataProviderFn implements CreditCurveDataProviderFn { @Override public Result<CreditCurveData> retrieveCreditCurveData(Environment env, CreditCurveDataKey key) { CreditCurveDataId curveDataId = CreditCurveDataId.of(_creditCurveDataName, key); return env.getMarketDataBundle().get(curveDataId, CreditCurveData.class); } DefaultCreditCurveDataProviderFn(String creditCurveDataName); @Override Result<CreditCurveData> retrieveCreditCurveData(Environment env, CreditCurveDataKey key);  }
@Test public void testFnMissingData() { Result<CreditCurveData> result = _fnWithUSDCurve.retrieveCreditCurveData(_env, _badKey); assertFalse(_badKey + " is missing so result should be failure.", result.isSuccess()); }
@Test public void testFn() { Result<CreditCurveData> result = _fnWithUSDCurve.retrieveCreditCurveData(_env, _goodKey); assertTrue(_goodKey + " present in snapshot so should succeed.", result.isSuccess()); }