Example test for
PersonSearchDAO . The two files
personin.bin and personout.bin are snapshots
from a real mainframe communication. Once created, the snapshot
files can be used to simulate mainframe access in tests.
The personin.bin file represents an empty person with an id of
1, which is the request. The personout.bin contains the
user data for the person with id 1. If we search for a user with id
1, the framework recognizes that the actual request matches the expected
request and returns the actual response (the personout.bin data).
If we pass 2 as the id, no response is found and findPersonById
returns an empty person. This example uses the
com.mockrunner.connector.StreamableRecordByteArrayInteraction which
works with byte data.
com.mockrunner.connector.StreamableRecordByteArrayInteraction can always be used when the involved Record classes implement
Streamable.