callDetectorControl.verify();
}
public void testMappingRecordOperationWithOutputRecordCreator() throws ResourceException {
MockControl connectionFactoryControl = MockControl.createControl(ConnectionFactory.class);
final ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
MockControl connectionControl = MockControl.createControl(Connection.class);
Connection connection = (Connection) connectionControl.getMock();
MockControl interactionControl = MockControl.createControl(Interaction.class);
Interaction interaction = (Interaction) interactionControl.getMock();
MockControl inputRecordControl = MockControl.createControl(Record.class);
Record inputRecord = (Record) inputRecordControl.getMock();
MockControl outputRecordControl = MockControl.createControl(Record.class);
Record outputRecord = (Record) outputRecordControl.getMock();
MockControl outputCreatorControl = MockControl.createControl(RecordCreator.class);
RecordCreator outputCreator = (RecordCreator) outputCreatorControl.getMock();
MockControl interactionSpecControl = MockControl.createControl(InteractionSpec.class);
InteractionSpec interactionSpec = (InteractionSpec) interactionSpecControl.getMock();
MockControl callDetectorControl = MockControl.createControl(QueryCallDetector.class);
QueryCallDetector callDetector = (QueryCallDetector) callDetectorControl.getMock();
MappingRecordOperationImpl query = new MappingRecordOperationImpl(connectionFactory, interactionSpec);
query.setOutputRecordCreator(outputCreator);
query.setCallDetector(callDetector);
Object inObj = new Object();
Object outObj = new Object();
connectionFactory.getRecordFactory();
connectionFactoryControl.setReturnValue(recordFactory, 1);
callDetector.callCreateInputRecord(recordFactory, inObj);
callDetectorControl.setReturnValue(inputRecord, 1);
connectionFactory.getConnection();
connectionFactoryControl.setReturnValue(connection, 1);
connection.createInteraction();
connectionControl.setReturnValue(interaction, 1);
connectionFactory.getRecordFactory();
connectionFactoryControl.setReturnValue(recordFactory, 1);
outputCreator.createRecord(recordFactory);
outputCreatorControl.setReturnValue(outputRecord, 1);