}
private String getResourceLinksResponse(String vserverId, String vserverName) throws CorrelationException {
- String url = getBaseUrl(getMsbSuffixAddr(AaiConfig.AAI_VNF_ADDR) + "vserver-id:EQUALS:" + vserverId);
+ String url = getBaseUrl(getMsbSuffixAddr(AaiConfig.AAI_VM_ADDR) + "vserver-id:EQUALS:" + vserverId);
String response = getResponse(url);
if ("".equals(response) || "{}".equals(response)) {
url = getBaseUrl(AaiConfig.AAI_VM_ADDR + "vserver-name:EQUALS:" + vserverName);
}
private String getVnfDataResponse(String vnfId, String vnfName) throws CorrelationException {
- String url = getBaseUrl(getMsbSuffixAddr(AaiConfig.AAI_VM_ADDR)+ "vnf-id=" + vnfId);
+ String url = getBaseUrl(getMsbSuffixAddr(AaiConfig.AAI_VNF_ADDR)+ "vnf-id=" + vnfId);
String response = getResponse(url);
if ("".equals(response) || "{}".equals(response)) {
url = getBaseUrl(AaiConfig.AAI_VNF_ADDR + "vnf-name=" + vnfName);
private String getMsbSuffixAddr(String suffixUrl) {
String[] addrSplits = suffixUrl.substring(1).split("/");
String ret = addrSplits[1];
- addrSplits[1] = addrSplits[2];
+ addrSplits[1] = addrSplits[0] + "-" + addrSplits[2];
addrSplits[2] = ret;
StringBuffer stringBuffer = new StringBuffer();
for (String split : addrSplits) {
--- /dev/null
+/**
+ * Copyright 2017 ZTE Corporation.
+ *
+ * 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.
+ */
+package org.onap.holmes.common.utils;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class DroolsLog {
+
+ public static void printError(String msg) {
+ log.error("Drools Log: " + msg);
+ }
+
+ public static void printWarn(String msg) {
+ log.warn("Drools Log: " + msg);
+ }
+
+ public static void printInfo(String msg) {
+ log.info("Drools Log: " + msg);
+ }
+
+ public static void printDebug(String msg) {
+ log.debug("Drools Log: " + msg);
+ }
+}
public void testAaiQuery_getMsbSuffixAddr_Ok() throws Exception {
PowerMock.resetAll();
String url = "/aai/v11/network/generic-vnfs/generic-vnf?";
- String expect = "/aai/network/v11/generic-vnfs/generic-vnf?";
+ String expect = "/aai/aai-network/v11/generic-vnfs/generic-vnf?";
aaiQuery = new AaiQuery();
PowerMock.replayAll();
String actual = Whitebox.invokeMethod(aaiQuery, "getMsbSuffixAddr", url);