logger.debug("RECORDING {}", restxRequest);
Factory factory = Factory.newInstance();
Set<GivenRecorder> recorders = factory.getComponents(RestxSpecRecorder.GivenRecorder.class);
RestxSessionCookieFilter sessionFilter = factory.getComponent(RestxSessionCookieFilter.class);
final RestxSpecRecorder restxSpecRecorder = new RestxSpecRecorder(
recorders, sessionFilter, storageSettings, repository);
try {
Optional<String> recordPath = restxRequest.getHeader("RestxRecordPath");
RestxSpecTape tape = restxSpecRecorder.record(restxRequest, restxResponse,
recordPath, restxRequest.getHeader("RestxRecordTitle"));
try {
router.route(tape.getRecordingRequest(), tape.getRecordingResponse());
} finally {
RestxSpecRecorder.RecordedSpec recordedSpec = restxSpecRecorder.stop(tape);
if (recordPath.isPresent()) {
if (recordedSpec.getSpec() == null) {
logger.warn("can't save spec, not properly recorded for {}", restxRequest);
} else {