Class
caplin.testing

DataSubscriptionFixture

The DataSubscriptionFixture serves to create a context for providing mock price message updates, through the use of 'caplin.message-service'.

Tests may use the DataSubscriptionFixture to:

  • update a record's data:
    given(PM is in state A)
    when("message.dataUpdateReceived => '/FX/USDGBP|DATA_UPDATE_1'")
    then(PM is in state B)
  • update a record's status:
    given(PM is in state A)
    when("message.dataStatusChanged => '/FX/USDGBP|STALE'")
    then(PM is in state B)
  • check if a record is subscribed to:
    given(PM is in state A)
    then("message.subjectRequested => '/FX/USDGBP'")
  • check if a record is not subscribed to:
    given(PM is in state A)
    then("message.subjectNotRequested => '/FX/USDGBP'")

Constructor Summary

Attributes Name and Description
caplin.testing.DataSubscriptionFixture()

Constructs a caplin.testing.DataSubscriptionFixture.

Method Summary

Attributes Name and Description
void addNamedValueMap(String name, Map values)

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 propertyName)

DataSubscriptionFixture can handle the properties 'dataUpdateReceived', 'dataStatusChanged', 'subjectRequested' and 'subjectNotRequested'.

void doGiven( propertyName, value)

void doThen( propertyName, value)

void doWhen( propertyName, value)

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 name, Map values)

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 name the data update identifier.
Map values the update data map from field names to field values.

void canHandleProperty(String propertyName)

DataSubscriptionFixture can handle the properties 'dataUpdateReceived', 'dataStatusChanged', 'subjectRequested' and 'subjectNotRequested'.

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

void doGiven( propertyName, value)

Parameters
propertyName
value
See
caplin.testing.Fixture#doGiven

void doThen( propertyName, value)

Parameters
propertyName
value
See
caplin.testing.Fixture#doThen

void doWhen( propertyName, value)

Parameters
propertyName
value
See
caplin.testing.Fixture#doWhen