FutureMonthCodeCurveInstrumentProvider implements CurveInstrumentProvider { @Override public ExternalId getInstrument(final LocalDate curveDate, final Tenor tenor) { throw new OpenGammaRuntimeException("Only futures supported"); } FutureMonthCodeCurveInstrumentProvider(final String futurePrefix, final String futureSuffix,
                                                final ExternalScheme scheme);  FutureMonthCodeCurveInstrumentProvider(final String futurePrefix, final String futureSuffix,
                                                final String dataField, final DataFieldType fieldType,
                                                final ExternalScheme scheme); @Override ExternalId getInstrument(final LocalDate curveDate, final Tenor tenor); @Override ExternalId getInstrument(final LocalDate curveDate, final Tenor tenor, final int periodsPerYear, final boolean isPeriodicZeroDeposit); @Override ExternalId getInstrument(final LocalDate curveDate, final Tenor tenor, final int numQuarterlyFuturesFromTenor); @Override ExternalId getInstrument(final LocalDate curveDate, final Tenor startTenor, final Tenor futureTenor, final int numFuturesFromTenor); @Override ExternalId getInstrument(final LocalDate curveDate, final Tenor tenor, final Tenor payTenor, final Tenor receiveTenor, final IndexType payIndexType,
      final IndexType receiveIndexType); @Override ExternalId getInstrument(final LocalDate curveDate, final Tenor tenor, final Tenor resetTenor, final IndexType indexType); @Override ExternalId getInstrument(final LocalDate curveDate, final Tenor startTenor, final int startIMMPeriods, final int endIMMPeriods); @Override String getMarketDataField(); @Override DataFieldType getDataFieldType(); String getFuturePrefix(); String getFutureSuffix(); ExternalScheme getScheme(); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test(expectedExceptions = OpenGammaRuntimeException.class) public void testNonFuture1() throws Exception { FutureMonthCodeCurveInstrumentProvider provider = new FutureMonthCodeCurveInstrumentProvider("AB", "CD", ExternalSchemes.OG_SYNTHETIC_TICKER); provider.getInstrument(NOW, Tenor.ONE_YEAR); }
@Test(expectedExceptions = OpenGammaRuntimeException.class) public void testNonFuture2() throws Exception { FutureMonthCodeCurveInstrumentProvider provider = new FutureMonthCodeCurveInstrumentProvider("AB", "CD", ExternalSchemes.OG_SYNTHETIC_TICKER); provider.getInstrument(NOW, Tenor.ONE_YEAR, 4, true); }
@Test(expectedExceptions = OpenGammaRuntimeException.class) public void testNonFuture3() throws Exception { FutureMonthCodeCurveInstrumentProvider provider = new FutureMonthCodeCurveInstrumentProvider("AB", "CD", ExternalSchemes.OG_SYNTHETIC_TICKER); provider.getInstrument(NOW, Tenor.ONE_YEAR, Tenor.ONE_YEAR, IndexType.Libor); }