What is the preferred way to unit test decoding of received messages?

Hi.
1. Is it possible to somehow dump into file received response so I can later recreate refresh/update message from it in my unit/integration tests?
2. Why none of ema data structures is serializable?
3. I also tried to create messages by hand

final RefreshMsg refreshMsg = EmaFactory.createRefreshMsg();
final FieldList fieldList = EmaFactory.createFieldList();
final FieldEntry fieldEntry = EmaFactory.createFieldEntry();
fieldEntry.realFromDouble(22, 1.3);
fieldList.add(fieldEntry);
refreshMsg.payload(fieldList);
But I receive `Exception Type='OmmInvalidUsageException', Text='Attempt to fieldList() while actual data type is NoData`

Best Answer

  • Steven McCoy
    Answer ✓

    You can use Codestreet's Replay Service as a testing facility.

    With EMA creating messages may not be fully functional until the provider interface has been implemented. You will have more success with ETA but there will be more boiler plate code to recreate first.

Answers