Increase code coverage for aai-common repo to 30%
[aai/aai-common.git] / aai-core / src / main / java / org / openecomp / aai / db / schema / AuditOXM.java
index 2da74d8..b7aab08 100644 (file)
@@ -5,16 +5,16 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
*      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  * ============LICENSE_END=========================================================
  */
 
@@ -33,12 +33,13 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.openecomp.aai.serialization.db.EdgeRule;
+import org.openecomp.aai.serialization.db.EdgeRules;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
 import org.openecomp.aai.db.props.AAIProperties;
-import org.openecomp.aai.dbmodel.DbEdgeRules;
 import org.openecomp.aai.introspection.Introspector;
 import org.openecomp.aai.introspection.Loader;
 import org.openecomp.aai.introspection.LoaderFactory;
@@ -221,14 +222,14 @@ public class AuditOXM extends Auditor {
         * Creates the edge labels.
         */
        private void createEdgeLabels() {
-               Multimap<String, String> edgeRules = DbEdgeRules.EdgeRules;
+               Multimap<String, EdgeRule> edgeRules = EdgeRules.getInstance().getAllRules();
                for (String key : edgeRules.keySet()) {
-                       Collection<String> collection = edgeRules.get(key);
+                       Collection<EdgeRule> collection = edgeRules.get(key);
                        EdgeProperty prop = new EdgeProperty();
                        //there is only ever one, they used the wrong type for EdgeRules
                        String label = "";
-                       for (String item : collection) {
-                               label = item.split(",")[0];
+                       for (EdgeRule item : collection) {
+                               label = item.getLabel();
                        }
                        prop.setName(label);
                        prop.setMultiplicity(Multiplicity.MULTI);