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'")
- send multiple data updates:
given(PM is in state A)
when("dataSubscription.multipleUpdatesReceived => '/FUT/LADDER/ZLE/Q11|PRICE_UPDATE|0-9'")
- send a subscription error:
given(PM is in state A)
when("dataSubscription.dataErrorReceived => '/FUT/LADDER/ZLE/Q11|NOT_FOUND'");