CurrencyExposureFunction implements ExposureFunction { @Override public List<ExternalId> getIds(Trade trade) { Security security = trade.getSecurity(); if (security instanceof FinancialSecurity) { return ((FinancialSecurity) security).accept(_currencyVisitor); } return null; } CurrencyExposureFunction(final SecuritySource securitySource); @Override String getName(); @Override List<ExternalId> getIds(Trade trade); static final String NAME; }
@Test public void testAgricultureFutureSecurity() { final AgricultureFutureSecurity future = ExposureFunctionTestHelper.getAgricultureFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testBondFutureOptionSecurity() { final BondFutureOptionSecurity security = ExposureFunctionTestHelper.getBondFutureOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testBondFutureSecurity() { final BondFutureSecurity future = ExposureFunctionTestHelper.getBondFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testCapFloorCMSSpreadSecurity() { final CapFloorCMSSpreadSecurity security = ExposureFunctionTestHelper.getCapFloorCMSSpreadSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testCapFloorSecurity() { final CapFloorSecurity security = ExposureFunctionTestHelper.getCapFloorSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testCashFlowSecurity() { final CashFlowSecurity security = ExposureFunctionTestHelper.getCashFlowSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testCashSecurity() { final CashSecurity cash = ExposureFunctionTestHelper.getCashSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(cash); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testContinuousZeroDepositSecurity() { final ContinuousZeroDepositSecurity security = ExposureFunctionTestHelper.getContinuousZeroDepositSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testCorporateBondSecurity() { final CorporateBondSecurity security = ExposureFunctionTestHelper.getCorporateBondSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testEnergyFutureOptionSecurity() { final CommodityFutureOptionSecurity security = ExposureFunctionTestHelper.getEnergyFutureOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testEnergyFutureSecurity() { final EnergyFutureSecurity future = ExposureFunctionTestHelper.getEnergyFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testEquityBarrierOptionSecurity() { final EquityBarrierOptionSecurity security = ExposureFunctionTestHelper.getEquityBarrierOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testEquityFutureSecurity() { final EquityFutureSecurity future = ExposureFunctionTestHelper.getEquityFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testEquityIndexDividendFutureSecurity() { final EquityIndexDividendFutureSecurity future = ExposureFunctionTestHelper.getEquityIndexDividendFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testEquitySecurity() { final EquitySecurity security = ExposureFunctionTestHelper.getEquitySecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testFRASecurity() { final FRASecurity fra = ExposureFunctionTestHelper.getFRASecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(fra); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testFXFutureSecurity() { final FXFutureSecurity future = ExposureFunctionTestHelper.getFXFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testFXVolatilitySecurity() { final FXVolatilitySwapSecurity security = ExposureFunctionTestHelper.getFXVolatilitySwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testIndexFutureSecurity() { final IndexFutureSecurity future = ExposureFunctionTestHelper.getIndexFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testInterestRateFutureSecurity() { final InterestRateFutureSecurity future = ExposureFunctionTestHelper.getInterestRateFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testFederalFundsFutureSecurity() { final FederalFundsFutureSecurity future = ExposureFunctionTestHelper.getFederalFundsFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testMetalFutureSecurity() { final MetalFutureSecurity future = ExposureFunctionTestHelper.getMetalFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testStockFutureSecurity() { final StockFutureSecurity future = ExposureFunctionTestHelper.getStockFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testAgricultureForwardSecurity() { final AgricultureForwardSecurity security = ExposureFunctionTestHelper.getAgricultureForwardSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testAgriculturalFutureSecurity() { final AgricultureFutureSecurity future = ExposureFunctionTestHelper.getAgricultureFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(future); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testCreditDefaultSwapIndexSecurity() { final CreditDefaultSwapIndexSecurity security = ExposureFunctionTestHelper.getCreditDefaultSwapIndexSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testCreditDefaultSwapOptionSecurity() { final CreditDefaultSwapOptionSecurity security = ExposureFunctionTestHelper.getCreditDefaultSwapOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testDeliverableSwapSecurity() { final DeliverableSwapFutureSecurity security = ExposureFunctionTestHelper.getDeliverableSwapFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testEnergyForwardSecurity() { final EnergyForwardSecurity security = ExposureFunctionTestHelper.getEnergyForwardSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testEquityIndexDividendFutureOptionSecurity() { final EquityIndexDividendFutureOptionSecurity security = ExposureFunctionTestHelper.getEquityIndexDividendFutureOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testEquityIndexFutureOptionSecurity() { final EquityIndexFutureOptionSecurity security = ExposureFunctionTestHelper.getEquityIndexFutureOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testEquityIndexOptionSecurity() { final EquityIndexOptionSecurity security = ExposureFunctionTestHelper.getEquityIndexOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testEquityOptionSecurity() { final EquityOptionSecurity security = ExposureFunctionTestHelper.getEquityOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testEquityVarianceSwapSecurity() { final EquityVarianceSwapSecurity security = ExposureFunctionTestHelper.getEquityVarianceSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testFixedFloatSwapSecurity() { final SwapSecurity security = ExposureFunctionTestHelper.getPayFixedFloatSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testFloatFloatSwapSecurity() { final SwapSecurity security = ExposureFunctionTestHelper.getFloatFloatSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testForwardFixedFloatSwapSecurity() { final ForwardSwapSecurity security = ExposureFunctionTestHelper.getPayForwardFixedFloatSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testForwardFloatFloatSwapSecurity() { final ForwardSwapSecurity security = ExposureFunctionTestHelper.getForwardFloatFloatSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testForwardXCcySwapSecurity() { final ForwardSwapSecurity security = ExposureFunctionTestHelper.getForwardXCcySwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testFXBarrierOptionSecurity() { final FXBarrierOptionSecurity security = ExposureFunctionTestHelper.getFXBarrierOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testFXDigitalOptionSecurity() { final FXDigitalOptionSecurity security = ExposureFunctionTestHelper.getFXDigitalOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testFXForwardSecurity() { final FXForwardSecurity security = ExposureFunctionTestHelper.getFXForwardSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testFXFutureOptionSecurity() { final FxFutureOptionSecurity security = ExposureFunctionTestHelper.getFXFutureOptionSecurity(); final FXFutureSecurity underlying = ExposureFunctionTestHelper.getFXFutureSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = new CurrencyExposureFunction(ExposureFunctionTestHelper.getSecuritySource(underlying)).getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testFXOptionSecurity() { final FXOptionSecurity security = ExposureFunctionTestHelper.getFXOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testGovernmentBondSecurity() { final GovernmentBondSecurity security = ExposureFunctionTestHelper.getGovernmentBondSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testInterestRateFutureOptionSecurity() { final IRFutureOptionSecurity security = ExposureFunctionTestHelper.getInterestRateFutureOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testLegacyFixedRecoveryCDSSecurity() { final LegacyFixedRecoveryCDSSecurity security = ExposureFunctionTestHelper.getLegacyFixedRecoveryCDSSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testLegacyRecoveryLockCDSSecurity() { final LegacyRecoveryLockCDSSecurity security = ExposureFunctionTestHelper.getLegacyRecoveryLockCDSSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testLegacyVanillaCDSSecurity() { final LegacyVanillaCDSSecurity security = ExposureFunctionTestHelper.getLegacyVanillaCDSSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testMetalForwardSecurity() { final MetalForwardSecurity security = ExposureFunctionTestHelper.getMetalForwardSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testMunicipalBondSecurity() { final MunicipalBondSecurity security = ExposureFunctionTestHelper.getMunicipalBondSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testNonDeliverableFXDigitalOptionSecurity() { final NonDeliverableFXDigitalOptionSecurity security = ExposureFunctionTestHelper.getNonDeliverableFXDigitalOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testNonDeliverableFXForwardSecurity() { final NonDeliverableFXForwardSecurity security = ExposureFunctionTestHelper.getNonDeliverableFXForwardSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testNonDeliverableFXOptionSecurity() { final NonDeliverableFXOptionSecurity security = ExposureFunctionTestHelper.getNonDeliverableFXOptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testPeriodicZeroDepositSecurity() { final PeriodicZeroDepositSecurity security = ExposureFunctionTestHelper.getPeriodicZeroDepositSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testSimpleZeroDepositSecurity() { final SimpleZeroDepositSecurity security = ExposureFunctionTestHelper.getSimpleZeroDepositSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testStandardFixedRecoveryCDSSecurity() { final StandardFixedRecoveryCDSSecurity security = ExposureFunctionTestHelper.getStandardFixedRecoveryCDSSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testStandardRecoveryLockCDSSecurity() { final StandardRecoveryLockCDSSecurity security = ExposureFunctionTestHelper.getStandardRecoveryLockCDSSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testStandardVanillaCDSSecurity() { final StandardVanillaCDSSecurity security = ExposureFunctionTestHelper.getStandardVanillaCDSSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testSwaptionSecurity() { final SwaptionSecurity security = ExposureFunctionTestHelper.getPaySwaptionSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "EUR"), ids.get(0)); }
@Test public void testXCcySwapSecurity() { final SwapSecurity security = ExposureFunctionTestHelper.getXCcySwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(2, ids.size()); assertTrue(ids.containsAll(Arrays.asList(ExternalId.of(SCHEME, "USD"), ExternalId.of(SCHEME, "EUR")))); }
@Test public void testPayYoYInflationSwapSecurity() { final YearOnYearInflationSwapSecurity security = ExposureFunctionTestHelper.getPayYoYInflationSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testReceiveYoYInflationSwapSecurity() { final YearOnYearInflationSwapSecurity security = ExposureFunctionTestHelper.getPayYoYInflationSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testPayZeroCouponInflationSwapSecurity() { final ZeroCouponInflationSwapSecurity security = ExposureFunctionTestHelper.getPayZeroCouponInflationSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }
@Test public void testReceiveZeroCouponInflationSwapSecurity() { final ZeroCouponInflationSwapSecurity security = ExposureFunctionTestHelper.getReceiveZeroCouponInflationSwapSecurity(); Trade trade = ExposureFunctionTestHelper.getTrade(security); List<ExternalId> ids = EXPOSURE_FUNCTION.getIds(trade); assertEquals(1, ids.size()); assertEquals(ExternalId.of(SCHEME, "USD"), ids.get(0)); }