From 4fe07922c0c85e9814f444d1aff7fbd4a294db19 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 18 Mar 2019 11:26:39 +0200 Subject: Fix getManualTasks double-addition of baseUrl Inline getManualTasks which was used only once, and adjusted the tests. Issue-ID: VID-403 Change-Id: Icf61586e0047d1d9fd828b8394da10fea8fabea0 Signed-off-by: Ittay Stern --- .../org/onap/vid/mso/rest/MsoRestClientNew.java | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap') diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java index b47981ecf..8dac0ce1b 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java @@ -22,6 +22,13 @@ package org.onap.vid.mso.rest; import com.google.common.collect.ImmutableMap; import io.joshworks.restclient.http.HttpResponse; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; import org.apache.commons.codec.binary.Base64; import org.eclipse.jetty.util.security.Password; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; @@ -31,17 +38,15 @@ import org.onap.vid.changeManagement.MsoRequestDetails; import org.onap.vid.changeManagement.RequestDetailsWrapper; import org.onap.vid.client.SyncRestClient; import org.onap.vid.model.RequestReferencesContainer; -import org.onap.vid.mso.*; +import org.onap.vid.mso.MsoInterface; +import org.onap.vid.mso.MsoProperties; +import org.onap.vid.mso.MsoResponseWrapper; +import org.onap.vid.mso.MsoResponseWrapperInterface; +import org.onap.vid.mso.MsoUtil; +import org.onap.vid.mso.RestMsoImplementation; +import org.onap.vid.mso.RestObject; import org.onap.vid.utils.Logging; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - /** * Created by pickjonathan on 21/06/2017. @@ -220,13 +225,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf return MsoUtil.wrapResponse(response); } - public MsoResponseWrapper getManualTasks(String endpoint) { - String path = baseUrl + endpoint; - - HttpResponse response = client.get(path, commonHeaders, new HashMap<>(), String.class); - return MsoUtil.wrapResponse(response); - } - + @Override public MsoResponseWrapper getManualTasksByRequestId(String t, String sourceId, String endpoint, RestObject restObject) { String methodName = "getManualTasksByRequestId"; logger.debug(methodName + START); @@ -234,9 +233,10 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf try { String path = baseUrl + endpoint; - MsoResponseWrapper w =getManualTasks(path); - logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse()); + HttpResponse response = client.get(path, commonHeaders, new HashMap<>(), String.class); + MsoResponseWrapper w = MsoUtil.wrapResponse(response); + logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse()); return w; } catch (Exception e) { -- cgit 1.2.3-korg