Class
caplin.testing

DataSubscriptionFixture

The DataSubscriptionFixture serves to create a context for providing mock price message updates, through the use of a DataSubscriberStub.

Tests may use the DataSubscriptionFixture to:

  • trigger price updates:
    given(PM is in state A)
    when("price.eventReceived => '/FX/USDGBP|FXTILE_UPDATES.TIER_UPDATE_1'")
    then(PM is in state B)

Constructor Summary

Attributes Name and Description
caplin.testing.DataSubscriptionFixture()

Constructs a caplin.testing.DataSubscriptionFixture.

Method Summary

Attributes Name and Description
void addNamedValueMap(String sName, Map mValues)

This method enables a FixtureFactory to register a set of data update identifiers and corresponding maps of mock field data with this DataSubscriptionFixture.

void canHandleProperty(String sProperty)

DataSubscriptionFixture can handle the property 'dataUpdateReceived'.

void doGiven(String sPropertyName, Variant vValue)

This method can be used with the 'dataUpdateReceived' property to trigger the stub to simulate data being received from the server.

void doThen(String sPropertyName, Variant vValue)

DataSubscriptionFixture does not support doThen.

void doWhen(String sPropertyName, Variant vValue)

This method can be used with the 'dataUpdateReceived' property to trigger the stub to simulate data being received from the server.

Methods implemented from class caplin.testing.Fixture:
addSubFixtures, setUp, tearDown

Constructor Detail

caplin.testing.DataSubscriptionFixture()

Constructs a caplin.testing.DataSubscriptionFixture.

Method Detail

void addNamedValueMap(String sName, Map mValues)

This method enables a FixtureFactory to register a set of data update identifiers and corresponding maps of mock field data with this DataSubscriptionFixture. Tests using the fixture to send mock data updates are able to refer to update data using property value 'Subject_name|Data_update_identifier'.

Parameters
String sName the data update identifier.
Map mValues the update data map from field names to field values.

void canHandleProperty(String sProperty)

DataSubscriptionFixture can handle the property 'dataUpdateReceived'.

Parameters
String sProperty The property to check.
See
caplin.testing.Fixture#canHandleProperty

void doGiven(String sPropertyName, Variant vValue)

This method can be used with the 'dataUpdateReceived' property to trigger the stub to simulate data being received from the server. The 'dataUpdateReceived' property must be supplied with a subject and data map id, in the format NAME|DATA, where DATA is the key for one of the name-value pairs already supplied (caplin.testing.DataSubscriptionFixture.addNamedValueMap).

Parameters
String sPropertyName The property name
Variant vValue The value to check
See
caplin.testing.Fixture#doGiven

void doThen(String sPropertyName, Variant vValue)

DataSubscriptionFixture does not support doThen.

Parameters
String sPropertyName The property name
Variant vValue The value to set
See
caplin.testing.Fixture#doThen

void doWhen(String sPropertyName, Variant vValue)

This method can be used with the 'dataUpdateReceived' property to trigger the stub to simulate data being received from the server. The 'dataUpdateReceived' property must be supplied with a subject and data map id, in the format NAME|DATA, where DATA is the key for one of the name-value pairs already supplied (caplin.testing.DataSubscriptionFixture.addNamedValueMap).

Parameters
String sPropertyName The property name
Variant vValue The value to set
See
caplin.testing.Fixture#doWhen