@Test(groups = TestGroup.UNIT)
public class VolatilitySurfaceSpecificationFudgeEncodingTest extends FinancialTestBase {
@Test
public void testSwaptionCycle() {
BloombergSwaptionVolatilitySurfaceInstrumentProvider instrumentProvider = new BloombergSwaptionVolatilitySurfaceInstrumentProvider("US", "SV", true, false, " Curncy");
VolatilitySurfaceSpecification spec = new VolatilitySurfaceSpecification("DEFAULT", Currency.USD, SurfaceAndCubeQuoteType.PAY_RECEIVE_DELTA, instrumentProvider);
AssertJUnit.assertEquals(spec, cycleObject(VolatilitySurfaceSpecification.class, spec));
instrumentProvider = new BloombergSwaptionVolatilitySurfaceInstrumentProvider("US", "SV", true, false, " Curncy", MarketDataRequirementNames.MARKET_VALUE);
spec = new VolatilitySurfaceSpecification("DEFAULT", Currency.USD, SurfaceAndCubeQuoteType.PAY_RECEIVE_DELTA, instrumentProvider);
AssertJUnit.assertEquals(spec, cycleObject(VolatilitySurfaceSpecification.class, spec));
instrumentProvider = new BloombergSwaptionVolatilitySurfaceInstrumentProvider("US", "SV", true, false, " Curncy", MarketDataRequirementNames.IMPLIED_VOLATILITY);
spec = new VolatilitySurfaceSpecification("DEFAULT", Currency.USD, SurfaceAndCubeQuoteType.PAY_RECEIVE_DELTA, instrumentProvider);
AssertJUnit.assertEquals(spec, cycleObject(VolatilitySurfaceSpecification.class, spec));
AssertJUnit.assertFalse(spec.equals(
cycleObject(VolatilitySurfaceSpecification.class,
new VolatilitySurfaceSpecification("DEFAULT",
Currency.USD,
SurfaceAndCubeQuoteType.PAY_RECEIVE_DELTA,
new BloombergSwaptionVolatilitySurfaceInstrumentProvider("US", "SV", true, false, " Curncy")))));
}