Using jmock how to reuse parameter
- by BenZen
I'm building a test, in wich i need to send question, and wait for the answer.
Message passing is not the problem. In fact to figure out wich answer correspond to wich question, i use an id. My id is generated using an UUID. an i want to retrieve this id, wich is given as a parameter to a mocked object.
It look like this:
oneOf(message).setJMSCorrelationID(with(correlationId));
inSequence(sequence);
Where correlationId is the string i'd like to keep for an other expecteation like this one:
oneOf(session).createBrowser(with(inputChannel),
with("JMSType ='pong' AND JMSCorrelationId = '"+correlationId+"'"));
have you got an answer?