diff --git a/src/java/com/mockey/model/UriTemplate.java b/src/java/com/mockey/model/UriTemplate.java index 0d3df3b..9abe6ab 100644 --- a/src/java/com/mockey/model/UriTemplate.java +++ b/src/java/com/mockey/model/UriTemplate.java @@ -49,7 +49,7 @@ public class UriTemplate { private static final Pattern NAMES_PATTERN = Pattern.compile("\\{([^/]+?)\\}"); /** Replaces template variables in the URI template. */ - private static final String VALUE_REGEX = "\\{(.*?)\\}"; + private static final String VALUE_REGEX = "(.*)"; private final List variableNames; diff --git a/src/java/com/mockey/storage/xml/MockeyXmlFileConfigurationGenerator.java b/src/java/com/mockey/storage/xml/MockeyXmlFileConfigurationGenerator.java index e8e833e..6e5f84d 100644 --- a/src/java/com/mockey/storage/xml/MockeyXmlFileConfigurationGenerator.java +++ b/src/java/com/mockey/storage/xml/MockeyXmlFileConfigurationGenerator.java @@ -181,6 +181,11 @@ private Element getServiceAsElement(Document document, getSafeForXmlOutputString("" + mockServiceBean.getDefaultRealUrlIndex())); + serviceElement.setAttribute( + "id", + getSafeForXmlOutputString("" + + mockServiceBean.getId())); + // Request validation rules in JSON format definition. Element requestInspectorJsonRulesElement = document .createElement("request_inspector_json_rules"); diff --git a/src/java/com/mockey/storage/xml/MockeyXmlFileConfigurationParser.java b/src/java/com/mockey/storage/xml/MockeyXmlFileConfigurationParser.java index f6fbecd..a1a5c88 100644 --- a/src/java/com/mockey/storage/xml/MockeyXmlFileConfigurationParser.java +++ b/src/java/com/mockey/storage/xml/MockeyXmlFileConfigurationParser.java @@ -143,6 +143,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc fullSetDigester.addSetProperties(ROOT_SERVICE, "hang_time", "hangTime"); fullSetDigester.addSetProperties(ROOT_SERVICE, "url", "url"); fullSetDigester.addSetProperties(ROOT_SERVICE, "tag", "tag"); + fullSetDigester.addSetProperties(ROOT_SERVICE, "id", "id"); // REMOVED March 2013. // No need to persist to a repot'. At run time, visual queue only. // fullSetDigester.addSetProperties(ROOT_SERVICE, "last_visit", diff --git a/src/java/com/mockey/storage/xml/MockeyXmlFileManager.java b/src/java/com/mockey/storage/xml/MockeyXmlFileManager.java index 7914278..ad8d355 100755 --- a/src/java/com/mockey/storage/xml/MockeyXmlFileManager.java +++ b/src/java/com/mockey/storage/xml/MockeyXmlFileManager.java @@ -400,7 +400,9 @@ private ServiceMergeResults addServicesToStore(ServiceMergeResults mergeResults, // YES, no in-store matching Name. // We null ID, to not write-over on any in-store // services with same ID - uploadedServiceBean.setId(null); + if(uploadedServiceBean.getId() == null) { + uploadedServiceBean.setId(null); + } // #TAG HANDLING - BEGIN // Ensure Service, and all it's child scenarios have