From 339d29c714f60de6e4e50b883259fc1a9a16ee84 Mon Sep 17 00:00:00 2001 From: Rodrigo Lima Date: Fri, 1 May 2020 15:25:06 -0400 Subject: Remove powermockito from OrchestrationTemplateCandidateImplTest - Remove powermockito from OrchestrationTemplateCandidateImplTest. Add new constructor to OrchestrationTemplateCandidateImpl Issue-ID: SDC-3007 Signed-off-by: Rodrigo Lima Change-Id: I5f0a2061796e8410a5b225c43baa70d7e0269684 --- .../OrchestrationTemplateCandidateImpl.java | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java index e4262df105..c331deb134 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java @@ -72,12 +72,27 @@ import org.springframework.stereotype.Service; public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplateCandidate { private static final Logger LOGGER = LoggerFactory.getLogger(OrchestrationTemplateCandidateImpl.class); - private OrchestrationTemplateCandidateManager candidateManager = - OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface(); - private VendorSoftwareProductManager vendorSoftwareProductManager = VspManagerFactory - .getInstance().createInterface(); - private ActivityLogManager activityLogManager = - ActivityLogManagerFactory.getInstance().createInterface(); + private final OrchestrationTemplateCandidateManager candidateManager; + + private final VendorSoftwareProductManager vendorSoftwareProductManager; + private final ActivityLogManager activityLogManager; + + + public OrchestrationTemplateCandidateImpl() { + this.candidateManager = OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface(); + this.vendorSoftwareProductManager = VspManagerFactory.getInstance().createInterface(); + this.activityLogManager = ActivityLogManagerFactory.getInstance().createInterface(); + } + + // Constructor used in test to avoid mock static + public OrchestrationTemplateCandidateImpl( + OrchestrationTemplateCandidateManager candidateManager, + VendorSoftwareProductManager vendorSoftwareProductManager, + ActivityLogManager activityLogManager) { + this.candidateManager = candidateManager; + this.vendorSoftwareProductManager = vendorSoftwareProductManager; + this.activityLogManager = activityLogManager; + } @Override public Response upload(final String vspId, final String versionId, -- cgit 1.2.3-korg