package org.openecomp.sdc.be.auditing.api;
+import java.util.List;
+
import org.javatuples.Pair;
import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
-import java.util.List;
-
public interface AuditEventFactory {
String getLogMessage();
package org.openecomp.sdc.be.auditing.impl;
+import java.util.Collections;
+import java.util.List;
+
import org.apache.commons.lang.StringUtils;
import org.javatuples.Pair;
import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.common.api.Constants;
-import java.util.Collections;
-import java.util.List;
-
public abstract class AuditBaseEventFactory implements AuditEventFactory {
//TODO imanzon: Check if requestId and serviceInstanceId fields are required for all tables.
package org.openecomp.sdc.be.auditing.impl;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Formatter;
+import java.util.Locale;
+import java.util.Map;
+
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Formatter;
-import java.util.Locale;
-import java.util.Map;
-
public class AuditingLogFormatUtil {
// When adding any new fields here, please keep the convention <fieldName>=
package org.openecomp.sdc.be.auditing.impl;
+import java.util.Map;
+import java.util.Map.Entry;
+
import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.util.Map;
-import java.util.Map.Entry;
-
@Component
public class AuditingManager {
package org.openecomp.sdc.be.components.csar;
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import fj.data.Either;
+import static org.openecomp.sdc.be.tosca.CsarUtils.ARTIFACTS_PATH;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
-import static org.openecomp.sdc.be.tosca.CsarUtils.ARTIFACTS_PATH;
+import fj.data.Either;
@org.springframework.stereotype.Component("csarArtifactsAndGroupsBusinessLogic")
package org.openecomp.sdc.be.components.distribution.engine;
+import java.net.ConnectException;
+import java.net.SocketTimeoutException;
+import java.util.Properties;
+import java.util.UUID;
+
+import javax.annotation.PostConstruct;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+
import org.apache.http.conn.ConnectTimeoutException;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.common.api.Constants;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import java.net.ConnectException;
-import java.net.SocketTimeoutException;
-import java.util.Properties;
-import java.util.UUID;
-
@Component
public class AaiRequestHandler {
package org.openecomp.sdc.be.components.distribution.engine;
-import org.openecomp.sdc.be.config.ConfigurationManager;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.common.api.ArtifactTypeEnum;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
+import org.openecomp.sdc.be.config.ConfigurationManager;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.common.api.ArtifactTypeEnum;
+
public class ArtifactInfoImpl implements IArtifactInfo {
private String artifactName;
package org.openecomp.sdc.be.components.distribution.engine;
-import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
-
import java.util.ArrayList;
import java.util.List;
+import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
+
public class CambriaErrorResponse {
public static final int HTTP_OK = 200;
package org.openecomp.sdc.be.components.distribution.engine;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.http.HttpStatus;
+import org.openecomp.sdc.be.config.BeEcompErrorManager;
+import org.openecomp.sdc.be.config.ConfigurationManager;
+import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
import com.att.nsa.apiClient.credentials.ApiCredential;
import com.att.nsa.apiClient.http.HttpException;
import com.att.nsa.apiClient.http.HttpObjectNotFoundException;
import com.att.nsa.cambria.client.CambriaTopicManager;
import com.google.common.annotations.VisibleForTesting;
import com.google.gson.Gson;
-import fj.data.Either;
-import org.apache.http.HttpStatus;
-import org.openecomp.sdc.be.config.BeEcompErrorManager;
-import org.openecomp.sdc.be.config.ConfigurationManager;
-import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.security.GeneralSecurityException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import fj.data.Either;
@Component("cambriaHandler")
public class CambriaHandler {
package org.openecomp.sdc.be.components.distribution.engine;
+import org.springframework.stereotype.Component;
+
import com.att.aft.dme2.api.DME2Exception;
import com.att.aft.dme2.api.DME2Manager;
import com.att.aft.dme2.iterator.DME2EndpointIterator;
import com.att.aft.dme2.iterator.factory.DME2EndpointIteratorFactory;
-import org.springframework.stereotype.Component;
-
@Component
public class DME2EndpointIteratorCreator {
package org.openecomp.sdc.be.components.distribution.engine;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.components.validation.ServiceDistributionValidation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
@Component("distributionEngine")
public class DistributionEngine implements IDistributionEngine {
package org.openecomp.sdc.be.components.distribution.engine;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.config.DistributionEngineConfiguration;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.api.HealthCheckInfo;
import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.AtomicBoolean;
-
@Component("distribution-engine-cluster-health")
public class DistributionEngineClusterHealth {
package org.openecomp.sdc.be.components.distribution.engine;
-import fj.data.Either;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Collectors;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.DistributionEngineConfiguration;
import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.stream.Collectors;
+import fj.data.Either;
public class DistributionEngineInitTask implements Runnable {
package org.openecomp.sdc.be.components.distribution.engine;
-import com.att.nsa.cambria.client.CambriaConsumer;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.openecomp.sdc.be.components.distribution.engine.report.DistributionCompleteReporter;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
+import com.att.nsa.cambria.client.CambriaConsumer;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import fj.data.Either;
public class DistributionEnginePollingTask implements Runnable {
package org.openecomp.sdc.be.components.distribution.engine;
-import com.att.nsa.mr.client.MRClientFactory;
-import com.att.nsa.mr.client.MRConsumer;
-import fj.data.Either;
+import java.io.File;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.Properties;
+
import org.openecomp.sdc.be.config.DmaapConsumerConfiguration;
import org.openecomp.sdc.security.SecurityUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.io.File;
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-import java.util.Properties;
+import com.att.nsa.mr.client.MRClientFactory;
+import com.att.nsa.mr.client.MRConsumer;
+
+import fj.data.Either;
/**
* Allows to create DMAAP client of type MRConsumer according received configuration parameters
package org.openecomp.sdc.be.components.distribution.engine;
-import com.att.nsa.mr.client.MRConsumer;
+import java.lang.Thread.UncaughtExceptionHandler;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Consumer;
+
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.config.DmaapConsumerConfiguration;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.lang.Thread.UncaughtExceptionHandler;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Consumer;
+import com.att.nsa.mr.client.MRConsumer;
/**
* Allows consuming DMAAP topic according to received consumer parameters
package org.openecomp.sdc.be.components.distribution.engine;
-import org.apache.commons.validator.routines.UrlValidator;
-import org.apache.http.client.utils.URIUtils;
-import org.openecomp.sdc.be.config.BeEcompErrorManager;
-import org.openecomp.sdc.be.config.ConfigurationManager;
-import org.openecomp.sdc.be.config.DmaapConsumerConfiguration;
-import org.openecomp.sdc.common.api.HealthCheckInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
+import static org.apache.commons.lang3.StringUtils.countMatches;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
+import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_DMAAP_ENGINE;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URI;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
-import static org.apache.commons.lang3.StringUtils.*;
-import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_DMAAP_ENGINE;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+import org.apache.commons.validator.routines.UrlValidator;
+import org.apache.http.client.utils.URIUtils;
+import org.openecomp.sdc.be.config.BeEcompErrorManager;
+import org.openecomp.sdc.be.config.ConfigurationManager;
+import org.openecomp.sdc.be.config.DmaapConsumerConfiguration;
+import org.openecomp.sdc.common.api.HealthCheckInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
@Component("dmaapHealth")
public class DmaapHealth {
package org.openecomp.sdc.be.components.distribution.engine;
-import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
-
import java.util.ArrayList;
import java.util.List;
+import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
+
/**
* a pojo which holds all the necessary data to communicate with the message bus
* this class is a reflection ot the {@link OperationalEnvironmentEntry} class
package org.openecomp.sdc.be.components.distribution.engine;
-import com.att.aft.dme2.api.DME2Exception;
-import com.att.aft.dme2.iterator.DME2EndpointIterator;
-import com.att.aft.dme2.iterator.domain.DME2EndpointReference;
-import com.att.aft.dme2.manager.registry.DME2Endpoint;
-import com.att.nsa.apiClient.credentials.ApiCredential;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.openecomp.sdc.common.datastructure.FunctionalInterfaces.runMethodWithTimeOut;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+
+import javax.annotation.PostConstruct;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpStatus;
import org.openecomp.sdc.be.components.distribution.engine.IDmaapNotificationData.DmaapActionEnum;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
-import javax.annotation.PostConstruct;
-import java.lang.Thread.UncaughtExceptionHandler;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.function.Function;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
+import com.att.aft.dme2.api.DME2Exception;
+import com.att.aft.dme2.iterator.DME2EndpointIterator;
+import com.att.aft.dme2.iterator.domain.DME2EndpointReference;
+import com.att.aft.dme2.manager.registry.DME2Endpoint;
+import com.att.nsa.apiClient.credentials.ApiCredential;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
-import static org.apache.commons.lang3.StringUtils.isEmpty;
-import static org.openecomp.sdc.common.datastructure.FunctionalInterfaces.runMethodWithTimeOut;
+import fj.data.Either;
/**
* Allows to consume DMAAP topic and handle received notifications
package org.openecomp.sdc.be.components.distribution.engine;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
@Component("executorFactory")
/**
* Allows to create next kinds of single thread executors: SingleThreadExecutor and SingleThreadScheduledExecutor
package org.openecomp.sdc.be.components.distribution.engine;
-import org.openecomp.sdc.be.model.ComponentInstance;
-
import java.util.List;
+import org.openecomp.sdc.be.model.ComponentInstance;
+
public class JsonContainerResourceInstance {
private String resourceInstanceName;
private String resourceName;
package org.openecomp.sdc.be.components.distribution.engine;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
import org.openecomp.sdc.be.config.DistributionEngineConfiguration.DistributionNotificationTopicConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.concurrent.*;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
public class NotificationExecutorService {
package org.openecomp.sdc.be.components.distribution.engine;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.config.ConfigurationManager;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentParametersView;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.model.category.CategoryDefinition;
import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.*;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component("serviceDistributionArtifactsBuilder")
public class ServiceDistributionArtifactsBuilder {
package org.openecomp.sdc.be.components.distribution.engine;
+import java.util.concurrent.Callable;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.concurrent.Callable;
-
public class UebHealthCheckCall implements Callable<Boolean> {
CambriaHandler cambriaHandler = new CambriaHandler();
package org.openecomp.sdc.be.components.distribution.engine;
-import org.openecomp.sdc.be.model.GroupDefinition;
-import org.openecomp.sdc.be.model.GroupInstance;
-import org.openecomp.sdc.be.model.GroupInstanceProperty;
-import org.openecomp.sdc.be.model.GroupProperty;
-import org.openecomp.sdc.common.api.Constants;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.GroupInstance;
+import org.openecomp.sdc.be.model.GroupInstanceProperty;
+import org.openecomp.sdc.be.model.GroupProperty;
+import org.openecomp.sdc.common.api.Constants;
+
public class VfModuleArtifactPayload {
private String vfModuleModelName, vfModuleModelInvariantUUID, vfModuleModelVersion, vfModuleModelUUID, vfModuleModelCustomizationUUID, vfModuleModelDescription;
package org.openecomp.sdc.be.components.distribution.engine.report;
+import javax.annotation.Resource;
+
import org.openecomp.sdc.be.components.distribution.engine.DistributionStatusNotification;
import org.openecomp.sdc.be.components.distribution.engine.rest.MSORestClient;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-
@Component
public class MsoDistributionCompleteReporter implements DistributionCompleteReporter {
package org.openecomp.sdc.be.components.distribution.engine.rest;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.gson.Gson;
+import java.util.Properties;
+
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.eclipse.jetty.util.URIUtil;
import org.openecomp.sdc.be.components.distribution.engine.DistributionStatusNotificationEnum;
import org.openecomp.sdc.be.config.ConfigurationManager;
-import org.openecomp.sdc.common.http.client.api.*;
+import org.openecomp.sdc.common.http.client.api.HttpExecuteException;
+import org.openecomp.sdc.common.http.client.api.HttpRequest;
+import org.openecomp.sdc.common.http.client.api.HttpResponse;
+import org.openecomp.sdc.common.http.client.api.Responses;
+import org.openecomp.sdc.common.http.client.api.RestUtils;
+import org.openecomp.sdc.common.http.client.api.RetryHandlers;
import org.openecomp.sdc.common.http.config.BasicAuthorization;
import org.openecomp.sdc.common.http.config.ExternalServiceConfig;
import org.openecomp.sdc.common.http.config.HttpClientConfig;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.util.Properties;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.gson.Gson;
@Component
public class MSORestClient {
package org.openecomp.sdc.be.components.health;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import static java.lang.String.format;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR;
+import static org.apache.http.HttpStatus.SC_OK;
+import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_BE;
+import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_CASSANDRA;
+import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_DCAE;
+import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_ES;
+import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_ON_BOARDING;
+import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_TITAN;
+import static org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus.DOWN;
+import static org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus.UP;
+import static org.openecomp.sdc.common.impl.ExternalConfiguration.getAppVersion;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.stream.Collectors;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.openecomp.sdc.be.components.distribution.engine.DistributionEngineClusterHealth;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.stream.Collectors;
-
-import static java.lang.String.format;
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR;
-import static org.apache.http.HttpStatus.SC_OK;
-import static org.openecomp.sdc.common.api.Constants.*;
-import static org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus.DOWN;
-import static org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus.UP;
-import static org.openecomp.sdc.common.impl.ExternalConfiguration.getAppVersion;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
@Component("healthCheckBusinessLogic")
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.tosca.converters.StringConvertor;
import org.openecomp.sdc.be.model.tosca.validators.StringValidator;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.util.ValidationUtils;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import java.util.List;
+import fj.data.Either;
@Component("additionalInformationBusinessLogic")
public class AdditionalInformationBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.components.ArtifactsResolver;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
@org.springframework.stereotype.Component("artifact-resolver")
public class ArtifactResolverImpl implements ArtifactsResolver {
package org.openecomp.sdc.be.components.impl;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.XMLConstants;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.xml.sax.XMLReader;
import org.yaml.snakeyaml.Yaml;
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Predicate;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import fj.data.Either;
@org.springframework.stereotype.Component("artifactBusinessLogic")
public class ArtifactsBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
+import fj.data.Either;
/**
* This class holds the business logic relevant for attributes manipulation.
package org.openecomp.sdc.be.components.impl;
-import com.google.gson.JsonElement;
-import fj.data.Either;
+import static org.apache.commons.collections.CollectionUtils.isEmpty;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.components.validation.UserValidations;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstanceInput;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.ComponentParametersView;
+import org.openecomp.sdc.be.model.DataTypeDefinition;
+import org.openecomp.sdc.be.model.GroupProperty;
+import org.openecomp.sdc.be.model.IComplexDefaultValue;
+import org.openecomp.sdc.be.model.IPropertyInputCommon;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache;
import org.openecomp.sdc.be.model.jsontitan.operations.ArtifactsOperations;
import org.openecomp.sdc.be.model.jsontitan.operations.ForwardingPathOperation;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
+import com.google.gson.JsonElement;
-import static org.apache.commons.collections.CollectionUtils.isEmpty;
+import fj.data.Either;
public abstract class BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Consumer;
+
+import javax.annotation.Resource;
+
import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.CapabilityTypeDefinition;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.model.operations.impl.CapabilityTypeOperation;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Consumer;
+import fj.data.Either;
@Component("capabilityTypeImportManager")
public class CapabilityTypeImportManager {
package org.openecomp.sdc.be.components.impl;
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.KeyspaceMetadata;
-import com.datastax.driver.core.Metadata;
-import com.datastax.driver.core.Session;
-import org.openecomp.sdc.be.config.ConfigurationManager;
-import org.openecomp.sdc.be.dao.cassandra.schema.SdcSchemaUtils;
-import org.openecomp.sdc.be.dao.cassandra.schema.Table;
-import org.openecomp.sdc.common.util.GeneralUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Properties;
import java.util.Set;
+import javax.annotation.PostConstruct;
+
+import org.openecomp.sdc.be.config.ConfigurationManager;
+import org.openecomp.sdc.be.dao.cassandra.schema.SdcSchemaUtils;
+import org.openecomp.sdc.be.dao.cassandra.schema.Table;
+import org.openecomp.sdc.common.util.GeneralUtility;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.KeyspaceMetadata;
+import com.datastax.driver.core.Metadata;
+import com.datastax.driver.core.Session;
+
@Component("cassandra-health-check")
public class CassandraHealthCheck {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datamodel.api.CategoryTypeEnum;
import org.openecomp.sdc.be.datamodel.utils.NodeTypeConvertUtils;
import org.springframework.stereotype.Component;
import org.yaml.snakeyaml.Yaml;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
+import fj.data.Either;
@Component("categoriesImportManager")
public class CategoriesImportManager {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.components.impl.ImportUtils.ResultStatusEnum;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.CapabilityTypeDefinition;
+import org.openecomp.sdc.be.model.DataTypeDefinition;
+import org.openecomp.sdc.be.model.GroupTypeDefinition;
+import org.openecomp.sdc.be.model.PolicyTypeDefinition;
+import org.openecomp.sdc.be.model.PropertyDefinition;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.stereotype.Component;
import org.yaml.snakeyaml.Yaml;
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.function.BiFunction;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component("commonImportManager")
public class CommonImportManager {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.CapReqDef;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceInput;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.ComponentParametersView;
+import org.openecomp.sdc.be.model.DataTypeDefinition;
+import org.openecomp.sdc.be.model.IComponentInstanceConnectedElement;
+import org.openecomp.sdc.be.model.InputDefinition;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Operation;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.cache.ComponentCache;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
+import fj.data.Either;
public abstract class ComponentBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import com.google.common.collect.Sets;
-import fj.data.Either;
+import static org.openecomp.sdc.be.components.property.GetInputUtils.isGetInputValueForInput;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.function.BiConsumer;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.openecomp.sdc.be.impl.ForwardingPathUtils;
import org.openecomp.sdc.be.info.CreateAndAssotiateInfo;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceInput;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.ComponentParametersView;
+import org.openecomp.sdc.be.model.DataTypeDefinition;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.InputDefinition;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.PropertyDefinition;
import org.openecomp.sdc.be.model.PropertyDefinition.PropertyNames;
+import org.openecomp.sdc.be.model.RelationshipInfo;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.RequirementDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.jsontitan.utils.ModelConverter;
import org.openecomp.sdc.be.model.operations.api.IComponentInstanceOperation;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.function.BiConsumer;
-import java.util.stream.Collectors;
+import com.google.common.collect.Sets;
-import static org.openecomp.sdc.be.components.property.GetInputUtils.isGetInputValueForInput;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
+import fj.data.Either;
/**
* This class holds the logic of arranging resource instance on the canvas for imported VF
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.Date;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.be.user.IUserBusinessLogic;
import org.openecomp.sdc.be.user.Role;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.util.ValidationUtils;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.util.Date;
+import fj.data.Either;
@Component("ConsumerBusinessLogic")
public class ConsumerBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
+import fj.data.Either;
public class CsarValidationUtils {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.components.impl.CommonImportManager.ElementTypeEnum;
import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component("dataTypeImportManager")
public class DataTypeImportManager {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.http.HttpStatus;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.*;
+import fj.data.Either;
@Component("distributionMonitoringBusinessLogic")
public class DistributionMonitoringBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
+import fj.data.Either;
@org.springframework.stereotype.Component("elementsBusinessLogic")
public class ElementBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
/**
* Created by yavivi on 04/02/2018.
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static java.util.stream.Collectors.toList;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.io.FilenameUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-import static java.util.stream.Collectors.toList;
+import fj.data.Either;
@org.springframework.stereotype.Component("groupBusinessLogic")
public class GroupBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
+import java.util.List;
+import java.util.Set;
+
import org.openecomp.sdc.be.components.impl.exceptions.ComponentException;
import org.openecomp.sdc.be.components.validation.UserValidations;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.stereotype.Component;
-import java.util.List;
-import java.util.Set;
-
@Component
public class GroupTypeBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.components.impl.CommonImportManager.ElementTypeEnum;
import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component("groupTypeImportManager")
public class GroupTypeImportManager {
package org.openecomp.sdc.be.components.impl;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-import fj.data.Either;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
import org.apache.commons.lang3.StringEscapeUtils;
import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
import org.openecomp.sdc.be.model.HeatParameterDefinition;
import org.yaml.snakeyaml.representer.Representer;
import org.yaml.snakeyaml.resolver.Resolver;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.function.Consumer;
-import java.util.function.Function;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.reflect.TypeToken;
+
+import fj.data.Either;
public final class ImportUtils {
private ImportUtils() {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+
import org.openecomp.sdc.be.components.property.PropertyDecelerationOrchestrator;
import org.openecomp.sdc.be.components.validation.ComponentValidations;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component("inputsBusinessLogic")
public class InputsBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.model.InterfaceDefinition;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@Component("interfaceLifecycleTypeImportManager")
public class InterfaceLifecycleTypeImportManager {
package org.openecomp.sdc.be.components.impl;
-import com.google.common.collect.Sets;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.UUID;
+import com.google.common.collect.Sets;
+
+import fj.data.Either;
@Component("interfaceOperationBusinessLogic")
public class InterfaceOperationBusinessLogic extends ComponentBusinessLogic{
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.impl.MonitoringDao;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
+import fj.data.Either;
+
@Component("monitoringBusinessLogic")
public class MonitoringBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.List;
+import java.util.Set;
+
import org.openecomp.sdc.be.components.validation.UserValidations;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.util.List;
-import java.util.Set;
+import fj.data.Either;
@Component
public class PolicyTypeBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Consumer;
+
+import javax.annotation.Resource;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.components.impl.CommonImportManager.ElementTypeEnum;
import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Consumer;
+import fj.data.Either;
@Component("policyTypeImportManager")
public class PolicyTypeImportManager {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datamodel.api.CategoryTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
+import fj.data.Either;
@org.springframework.stereotype.Component("productBusinessLogic")
public class ProductBusinessLogic extends ComponentBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import com.google.gson.JsonElement;
-import fj.data.Either;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.function.Supplier;
+
+import javax.servlet.ServletContext;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.function.Supplier;
+import com.google.gson.JsonElement;
+
+import fj.data.Either;
@Component("propertyBusinessLogic")
public class PropertyBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import com.google.common.collect.Sets;
-import com.google.gson.Gson;
-import fj.data.Either;
+import static org.openecomp.sdc.be.tosca.CsarUtils.VF_NODE_TYPE_ARTIFACTS_PATH_PATTERN;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import javax.servlet.ServletContext;
+
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction.LifecycleChanceActionEnum;
import org.openecomp.sdc.be.components.merge.resource.MergeResourceBLFactory;
import org.openecomp.sdc.be.components.merge.resource.MergeResourceBusinessLogic;
-import org.openecomp.sdc.be.components.validation.InterfaceOperationValidation;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.parser.ParserException;
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
+import com.google.gson.Gson;
-import static org.openecomp.sdc.be.tosca.CsarUtils.VF_NODE_TYPE_ARTIFACTS_PATH_PATTERN;
+import fj.data.Either;
@org.springframework.stereotype.Component("resourceBusinessLogic")
public class ResourceBusinessLogic extends ComponentBusinessLogic {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import javax.servlet.ServletContext;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
import org.springframework.web.context.WebApplicationContext;
import org.yaml.snakeyaml.Yaml;
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component("resourceImportManager")
public class ResourceImportManager {
package org.openecomp.sdc.be.components.impl;
-import com.google.common.base.Strings;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.function.Function;
-import java.util.stream.Collectors;
+import com.google.common.base.Strings;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import fj.data.Either;
@org.springframework.stereotype.Component("serviceBusinessLogic")
public class ServiceBusinessLogic extends ComponentBusinessLogic {
package org.openecomp.sdc.be.components.impl.generic;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class GenericTypeBusinessLogic {
package org.openecomp.sdc.be.components.impl.utils;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.dao.utils.MapUtil;
import org.openecomp.sdc.be.model.PolicyTypeDefinition;
import org.openecomp.sdc.be.model.PropertyDefinition;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
public class PolicyTypeImportUtils {
private PolicyTypeImportUtils() {
package org.openecomp.sdc.be.components.impl.version;
+import static org.apache.commons.collections.CollectionUtils.isEmpty;
+
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.model.jsontitan.operations.GroupsOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
-import java.util.List;
-import java.util.Map;
-
-import static org.apache.commons.collections.CollectionUtils.isEmpty;
@org.springframework.stereotype.Component
public class GroupMembersUpdateOperation implements PostChangeVersionOperation {
package org.openecomp.sdc.be.components.impl.version;
+import static org.apache.commons.collections.CollectionUtils.isEmpty;
+
+import java.util.List;
+import java.util.function.UnaryOperator;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.model.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.List;
-import java.util.function.UnaryOperator;
-
-import static org.apache.commons.collections.CollectionUtils.isEmpty;
-
@org.springframework.stereotype.Component
public class PolicyTargetsUpdateOperation implements PostChangeVersionOperation {
package org.openecomp.sdc.be.components.impl.version;
+import java.util.Iterator;
+import java.util.List;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Iterator;
-import java.util.List;
-
@org.springframework.stereotype.Component
public class PostChangeVersionOperationOrchestrator {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import java.util.Arrays;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
+import fj.data.Either;
public class CertificationChangeTransition extends LifeCycleTransition {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic;
import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.LifeCycleTransitionEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Operation;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaElementLifecycleOperation;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.*;
+import fj.data.Either;
public class CertificationRequestTransition extends LifeCycleTransition {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import java.util.Arrays;
+
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
+import fj.data.Either;
public class CheckinTransition extends LifeCycleTransition {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import java.util.Arrays;
+import java.util.List;
+
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.InputDefinition;
+import org.openecomp.sdc.be.model.LifeCycleTransitionEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement;
import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElementTypeEnum;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaElementLifecycleOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
-import java.util.List;
+import fj.data.Either;
public class CheckoutTransition extends LifeCycleTransition {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction.LifecycleChanceActionEnum;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
public abstract class LifeCycleTransition {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+
import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import javax.annotation.PostConstruct;
-import java.util.HashMap;
-import java.util.Map;
+import fj.data.Either;
@org.springframework.stereotype.Component("lifecycleBusinessLogic")
public class LifecycleBusinessLogic {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import java.util.Arrays;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
+import fj.data.Either;
public class UndoCheckoutTransition extends LifeCycleTransition {
private static final Logger log = LoggerFactory.getLogger(CheckoutTransition.class);
package org.openecomp.sdc.be.components.merge;
-import fj.data.Either;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
import org.openecomp.sdc.be.components.impl.BaseBusinessLogic;
import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.springframework.stereotype.Component;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component
public class GlobalInputsFilteringBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.merge;
-import fj.data.Either;
+import java.util.List;
+
import org.openecomp.sdc.be.components.merge.input.ComponentInputsMergeBL;
import org.openecomp.sdc.be.components.merge.resource.MergeResourceBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.util.List;
+import fj.data.Either;
@Component
public class GlobalTypesMergeBusinessLogic implements MergeResourceBusinessLogic {
package org.openecomp.sdc.be.components.merge;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.RelationshipInfo;
import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
import org.openecomp.sdc.be.model.Resource;
import org.springframework.stereotype.Component;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
@Component
public class RelationsComparator {
package org.openecomp.sdc.be.components.merge;
-import fj.data.Either;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.utils.MapUtil;
import org.openecomp.sdc.be.exception.SdcActionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class TopologyComparator {
package org.openecomp.sdc.be.components.merge.capability;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.model.CapabilityDefinition;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstance;
-import java.util.List;
-import java.util.Map;
-
public interface CapabilityResolver {
/**
package org.openecomp.sdc.be.components.merge.capability;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.components.merge.utils.MergeInstanceUtils;
import org.openecomp.sdc.be.dao.utils.MapUtil;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstance;
-import java.util.*;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
@org.springframework.stereotype.Component
public class SimpleCapabilityResolver implements CapabilityResolver {
package org.openecomp.sdc.be.components.merge.heat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.dao.utils.MapUtil;
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.HeatParameterDefinition;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
/**
* Created by chaya on 9/14/2017.
*/
package org.openecomp.sdc.be.components.merge.input;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.components.merge.instance.ComponentsMergeCommand;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.utils.MapUtil;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentInputsMergeBL implements ComponentsMergeCommand {
package org.openecomp.sdc.be.components.merge.input;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
import org.apache.commons.lang.StringUtils;
import org.openecomp.sdc.be.dao.utils.MapUtil;
import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.InputDefinition;
-import java.util.*;
-import java.util.stream.Collectors;
-
@org.springframework.stereotype.Component
public class InputsValuesMergingBusinessLogic {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.components.merge.capability.CapabilityResolver;
import org.openecomp.sdc.be.components.merge.property.DataDefinitionsValuesMergingBusinessLogic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentCapabilitiesPropertiesMergeBL implements ComponentsMergeCommand {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-import java.util.stream.Collectors;
+import fj.data.Either;
/**
* Created by chaya on 9/20/2017.
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import static org.apache.commons.collections.MapUtils.isNotEmpty;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.model.CapabilityDefinition;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static org.apache.commons.collections.MapUtils.isNotEmpty;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentInstanceCapabiliteisPropertiesMerge implements ComponentInstanceMergeInterface {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
import org.javatuples.Pair;
import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentInstanceForwardingPathMerge implements ComponentInstanceMergeInterface {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.merge.heat.HeatEnvArtifactsMergeBusinessLogic;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
/**
* Created by chaya on 9/20/2017.
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.components.merge.property.DataDefinitionsValuesMergingBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentInstanceInputsMergeBL implements ComponentsMergeCommand {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import java.util.List;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.model.Component;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.List;
+import fj.data.Either;
/**
* Created by chaya on 9/12/2017.
*/
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.exception.ResponseFormat;
+import fj.data.Either;
+
/**
* Created by chaya on 9/20/2017.
*/
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.components.merge.property.DataDefinitionsValuesMergingBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentInstancePropertiesMergeBL implements ComponentsMergeCommand {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.List;
+
import org.openecomp.sdc.be.components.merge.input.ComponentInputsMergeBL;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceInput;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.ComponentParametersView;
+import org.openecomp.sdc.be.model.InputDefinition;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.List;
+import fj.data.Either;
/**
* Created by chaya on 9/20/2017.
import java.util.List;
import java.util.Map;
import java.util.Optional;
+
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.CapabilityDefinition;
import org.openecomp.sdc.be.model.Component;
package org.openecomp.sdc.be.components.merge.property;
+import java.util.Collections;
+import java.util.List;
+
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.openecomp.sdc.be.model.InputDefinition;
import org.springframework.stereotype.Component;
-import java.util.Collections;
-import java.util.List;
-
@Component
public class DataDefinitionsValuesMergingBusinessLogic {
package org.openecomp.sdc.be.components.merge.property;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-
import java.util.ArrayList;
import java.util.List;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+
/**
* A POJO which represents an instance property data definition (a {@link org.openecomp.sdc.be.model.ComponentInstanceProperty} or {@link org.openecomp.sdc.be.model.ComponentInstanceInput})
* that its value needs to be merged during an upgrade of a VSP.
package org.openecomp.sdc.be.components.merge.property;
-import com.google.gson.Gson;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.stream.Collectors;
+import com.google.gson.Gson;
+
+import fj.data.Either;
@Component
public class PropertyDataValueMergeBusinessLogic {
package org.openecomp.sdc.be.components.merge.property;
-import org.openecomp.sdc.be.dao.utils.MapUtil;
-import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-import org.openecomp.sdc.be.model.InputDefinition;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
+import org.openecomp.sdc.be.dao.utils.MapUtil;
+import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.model.InputDefinition;
+
public class PropertyInstanceMergeDataBuilder {
private final static PropertyInstanceMergeDataBuilder INSTANCE = new PropertyInstanceMergeDataBuilder();
package org.openecomp.sdc.be.components.merge.property;
-import org.apache.commons.lang.StringUtils;
-import org.openecomp.sdc.be.components.impl.ImportUtils;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.sdc.be.components.impl.ImportUtils;
+
public abstract class PropertyValueMerger {
abstract Object merge(Object oldVal, Object newVal, List<String> someStrings);
package org.openecomp.sdc.be.components.merge.property;
-import org.springframework.stereotype.Component;
-
import java.util.List;
+import org.springframework.stereotype.Component;
+
@Component("scalar-prop-value-merger")
public class ScalarPropertyValueMerger extends PropertyValueMerger {
package org.openecomp.sdc.be.components.merge.resource;
-import fj.data.Either;
import org.openecomp.sdc.be.components.merge.GlobalTypesMergeBusinessLogic;
import org.openecomp.sdc.be.components.merge.TopologyComparator;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.Resource;
import org.springframework.stereotype.Component;
+import fj.data.Either;
+
@Component
public class MergeResourceBLFactory {
package org.openecomp.sdc.be.components.merge.resource;
+import java.util.List;
+
import org.openecomp.sdc.be.components.merge.instance.ComponentsMergeCommand;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.Resource;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.util.List;
-
@Component
public class ResourceDataMergeBusinessLogic implements MergeResourceBusinessLogic {
package org.openecomp.sdc.be.components.merge.utils;
-import fj.data.Either;
+import static java.util.function.Function.identity;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.Component;
import org.springframework.beans.factory.annotation.Autowired;
import com.google.common.annotations.VisibleForTesting;
-import java.util.*;
-import java.util.stream.Collectors;
-import static java.util.function.Function.identity;
+import fj.data.Either;
/**
* This class is Utils class but it should be bean
package org.openecomp.sdc.be.components.path;
-import fj.data.Either;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.commons.lang.StringUtils;
import org.openecomp.sdc.be.components.impl.ResponseFormatManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
+import fj.data.Either;
@Component("forwardingPathValidator")
public class ForwardingPathValidator {
package org.openecomp.sdc.be.components.property;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentInstanceInputPropertyDecelerator extends DefaultPropertyDecelerator<ComponentInstance, ComponentInstanceInput> {
package org.openecomp.sdc.be.components.property;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class ComponentInstancePropertyDecelerator extends DefaultPropertyDecelerator<ComponentInstance, ComponentInstanceProperty> {
package org.openecomp.sdc.be.components.property;
-import com.google.gson.Gson;
-import fj.data.Either;
+import static org.openecomp.sdc.common.api.Constants.GET_INPUT;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.json.simple.JSONObject;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
+import com.google.gson.Gson;
-import static org.openecomp.sdc.common.api.Constants.GET_INPUT;
+import fj.data.Either;
public abstract class DefaultPropertyDecelerator<PROPERTYOWNER extends PropertiesOwner, PROPERTYTYPE extends PropertyDataDefinition> implements PropertyDecelerator {
package org.openecomp.sdc.be.components.property;
-import fj.data.Either;
+import static org.openecomp.sdc.be.components.property.GetInputUtils.isGetInputValueForInput;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.datatypes.elements.PolicyDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import static org.openecomp.sdc.be.components.property.GetInputUtils.isGetInputValueForInput;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class PolicyPropertyDecelerator extends DefaultPropertyDecelerator<PolicyDefinition, PropertyDataDefinition> {
package org.openecomp.sdc.be.components.property;
-import fj.data.Either;
+import java.util.Arrays;
+import java.util.List;
+
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.openecomp.sdc.be.model.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
-import java.util.List;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class PropertyDecelerationOrchestrator {
package org.openecomp.sdc.be.components.property;
-import fj.data.Either;
+import java.util.List;
+
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstancePropInput;
import org.openecomp.sdc.be.model.InputDefinition;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.List;
+import fj.data.Either;
public interface PropertyDecelerator {
package org.openecomp.sdc.be.components.scheduledtasks;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public abstract class AbstractScheduleTaskRunner {
private static final Logger log = LoggerFactory.getLogger(AbstractScheduleTaskRunner.class);
public abstract ExecutorService getExecutorService();
package org.openecomp.sdc.be.components.scheduledtasks;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.CleanComponentsConfiguration;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
@Component("asdcComponentsCleaner")
public class AsdcComponentsCleanerTask extends AbstractScheduleTaskRunner implements Runnable {
package org.openecomp.sdc.be.components.scheduledtasks;
-import fj.data.Either;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.components.impl.BaseBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@Component("componentsCleanBusinessLogic")
public class ComponentsCleanBusinessLogic extends BaseBusinessLogic {
package org.openecomp.sdc.be.components.scheduledtasks;
-import com.google.common.annotations.VisibleForTesting;
-import fj.data.Either;
+import static org.apache.commons.collections.CollectionUtils.isEmpty;
+import static org.openecomp.sdc.common.datastructure.FunctionalInterfaces.convertToFunction;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.openecomp.sdc.be.components.distribution.engine.EnvironmentsEngine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
+import com.google.common.annotations.VisibleForTesting;
-import static org.apache.commons.collections.CollectionUtils.isEmpty;
-import static org.openecomp.sdc.common.datastructure.FunctionalInterfaces.convertToFunction;
+import fj.data.Either;
@Component("recoveryThreadManager")
public class RecoveryThreadManager extends AbstractScheduleTaskRunner {
package org.openecomp.sdc.be.components.utils;
-import org.apache.tinkerpop.shaded.minlog.Log;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.validation.constraints.NotNull;
import java.security.SecureRandom;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import javax.validation.constraints.NotNull;
+
+import org.apache.tinkerpop.shaded.minlog.Log;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class Utils {
private static final Logger log = LoggerFactory.getLogger(Utils.class);
package org.openecomp.sdc.be.components.validation;
+import static java.util.stream.Collectors.toList;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.components.impl.exceptions.ComponentException;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.ComponentParametersView;
import org.openecomp.sdc.be.model.operations.utils.ComponentValidationUtils;
import org.openecomp.sdc.common.util.ValidationUtils;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static java.util.stream.Collectors.toList;
-
@org.springframework.stereotype.Component
public final class ComponentValidations {
package org.openecomp.sdc.be.components.validation;
-import fj.data.Either;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component("interfaceOperationValidation")
public class InterfaceOperationValidation {
package org.openecomp.sdc.be.components.validation;
-import fj.data.Either;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
+import fj.data.Either;
/**
* Provides specific functionality for policy
package org.openecomp.sdc.be.components.validation;
-import fj.data.Either;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.annotation.Resource;
+
import org.apache.commons.lang.StringUtils;
import org.openecomp.sdc.be.components.distribution.engine.IDistributionEngine;
import org.openecomp.sdc.be.components.impl.ActivationRequestInformation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.annotation.Resource;
-import java.util.Arrays;
-import java.util.List;
+import fj.data.Either;
/**
* Created by chaya on 10/18/2017.
package org.openecomp.sdc.be.components.validation;
-import fj.data.Either;
+import java.util.List;
+
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.List;
+import fj.data.Either;
@org.springframework.stereotype.Component
public class UserValidations {
package org.openecomp.sdc.be.datamodel.utils;
-import org.apache.commons.codec.binary.Base64;
-import org.openecomp.sdc.be.info.ArtifactTemplateInfo;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-import org.openecomp.sdc.common.api.ArtifactTypeEnum;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.util.ValidationUtils;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.stream.Collectors;
+import org.apache.commons.codec.binary.Base64;
+import org.openecomp.sdc.be.info.ArtifactTemplateInfo;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.openecomp.sdc.common.api.ArtifactTypeEnum;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.util.ValidationUtils;
public class ArtifactUtils {
package org.openecomp.sdc.be.datamodel.utils;
+import java.util.List;
+import java.util.stream.Collectors;
+
import org.openecomp.sdc.be.datatypes.elements.InterfaceOperationDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.InterfaceOperationParamDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
import org.openecomp.sdc.be.model.Operation;
-import java.util.List;
-import java.util.stream.Collectors;
-
public class InterfaceUIDataConverter {
private InterfaceUIDataConverter () {
package org.openecomp.sdc.be.datamodel.utils;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition;
import org.openecomp.sdc.be.datatypes.components.ServiceMetadataDataDefinition;
import org.openecomp.sdc.be.datatypes.enums.ComponentFieldsEnum;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.ui.model.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
+import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer;
+import org.openecomp.sdc.be.ui.model.UiComponentMetadata;
+import org.openecomp.sdc.be.ui.model.UiResourceDataTransfer;
+import org.openecomp.sdc.be.ui.model.UiResourceMetadata;
+import org.openecomp.sdc.be.ui.model.UiServiceDataTransfer;
+import org.openecomp.sdc.be.ui.model.UiServiceMetadata;
public class UiComponentDataConverter {
package org.openecomp.sdc.be.distribution;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import static org.apache.commons.lang.BooleanUtils.isTrue;
+import static org.openecomp.sdc.be.components.distribution.engine.DistributionEngineInitTask.buildTopicName;
+import static org.openecomp.sdc.be.config.ConfigurationManager.getConfigurationManager;
+
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.ws.rs.core.Response;
+
import org.apache.http.HttpStatus;
-import org.openecomp.sdc.be.components.distribution.engine.*;
+import org.openecomp.sdc.be.components.distribution.engine.CambriaErrorResponse;
+import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler;
+import org.openecomp.sdc.be.components.distribution.engine.DistributionEngineInitTask;
+import org.openecomp.sdc.be.components.distribution.engine.IDistributionEngine;
+import org.openecomp.sdc.be.components.distribution.engine.SubscriberTypeEnum;
import org.openecomp.sdc.be.components.impl.ResponseFormatManager;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.config.DistributionEngineConfiguration;
import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.distribution.api.client.*;
+import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
+import org.openecomp.sdc.be.distribution.api.client.RegistrationRequest;
+import org.openecomp.sdc.be.distribution.api.client.ServerListResponse;
+import org.openecomp.sdc.be.distribution.api.client.TopicRegistrationResponse;
+import org.openecomp.sdc.be.distribution.api.client.TopicUnregistrationResponse;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import javax.ws.rs.core.Response;
-import java.util.List;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
-import static org.apache.commons.lang.BooleanUtils.isTrue;
-import static org.openecomp.sdc.be.components.distribution.engine.DistributionEngineInitTask.buildTopicName;
-import static org.openecomp.sdc.be.config.ConfigurationManager.getConfigurationManager;
+import fj.data.Either;
@Component("distributionBusinessLogic")
public class DistributionBusinessLogic {
package org.openecomp.sdc.be.distribution.servlet;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
-import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
import org.openecomp.sdc.be.servlets.BeGenericServlet;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.Map;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* This Servlet serves external users to download artifacts.
package org.openecomp.sdc.be.distribution.servlet;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import javax.annotation.Resource;
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.distribution.AuditHandler;
import org.openecomp.sdc.be.servlets.BeGenericServlet;
import org.openecomp.sdc.common.api.ArtifactTypeEnum;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.openecomp.sdc.common.util.HttpUtil;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import io.swagger.annotations.ResponseHeader;
/**
* This Servlet serves external users for distribution purposes.
package org.openecomp.sdc.be.ecomp;
-import fj.data.Either;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
import org.openecomp.portalsdk.core.onboarding.crossapi.IPortalRestAPIService;
import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
import org.openecomp.portalsdk.core.restful.domain.EcompRole;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.ContextLoader;
-import javax.servlet.http.HttpServletRequest;
-import java.util.LinkedList;
-import java.util.List;
+import fj.data.Either;
public class EcompIntImpl implements IPortalRestAPIService {
package org.openecomp.sdc.be.ecomp.converters;
-import fj.data.Either;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.distribution.servlet.DistributionCatalogServlet;
-import org.openecomp.sdc.be.externalapi.servlet.representation.*;
+import org.openecomp.sdc.be.externalapi.servlet.representation.ArtifactMetadata;
+import org.openecomp.sdc.be.externalapi.servlet.representation.AssetMetadata;
+import org.openecomp.sdc.be.externalapi.servlet.representation.ResourceAssetDetailedMetadata;
+import org.openecomp.sdc.be.externalapi.servlet.representation.ResourceAssetMetadata;
+import org.openecomp.sdc.be.externalapi.servlet.representation.ResourceInstanceMetadata;
+import org.openecomp.sdc.be.externalapi.servlet.representation.ServiceAssetDetailedMetadata;
+import org.openecomp.sdc.be.externalapi.servlet.representation.ServiceAssetMetadata;
import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.model.category.CategoryDefinition;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.*;
+import fj.data.Either;
@org.springframework.stereotype.Component("asset-metadata-utils")
public class AssetMetadataConverter {
package org.openecomp.sdc.be.ecomp.converters;
-import fj.data.Either;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
import org.openecomp.portalsdk.core.restful.domain.EcompRole;
import org.openecomp.portalsdk.core.restful.domain.EcompUser;
import org.openecomp.sdc.be.dao.utils.UserStatusEnum;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.user.Role;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
+import fj.data.Either;
public final class EcompUserConverter {
package org.openecomp.sdc.be.externalapi.servlet;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.Map;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* This Servlet serves external users operations on artifacts.
*
package org.openecomp.sdc.be.externalapi.servlet;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.components.impl.ElementBusinessLogic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* This Servlet serves external users for retrieving component metadata.
package org.openecomp.sdc.be.externalapi.servlet;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.lang3.StringUtils;
-import com.fasterxml.jackson.databind.ObjectMapper;
import org.elasticsearch.common.Strings;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.ecomp.converters.AssetMetadataConverter;
import org.openecomp.sdc.be.externalapi.servlet.representation.AssetMetadata;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.LifeCycleTransitionEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.category.CategoryDefinition;
import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.be.servlets.RepresentationUtils;
import org.openecomp.sdc.be.utils.CommonBeUtils;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.openecomp.sdc.common.util.ValidationUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.EnumMap;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
package org.openecomp.sdc.be.externalapi.servlet;
-import fj.data.Either;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.ExternalRefsBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dto.ExternalRefDTO;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@Path("/v1/catalog")
package org.openecomp.sdc.be.externalapi.servlet;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.io.IOException;
+import java.util.EnumMap;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.util.EnumMap;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* Created by chaya on 10/17/2017.
package org.openecomp.sdc.be.filters;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.StringTokenizer;
+
+import javax.annotation.Priority;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.ResponseBuilder;
+import javax.ws.rs.core.Response.Status;
+
import org.apache.commons.codec.binary.Base64;
import org.openecomp.sdc.be.components.impl.ConsumerBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.annotation.Priority;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.Response.Status;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.StringTokenizer;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import fj.data.Either;
@Priority(10)
public class BasicAuthenticationFilter implements ContainerRequestFilter {
package org.openecomp.sdc.be.filters;
-import com.google.gson.GsonBuilder;
+import java.io.IOException;
+import java.util.UUID;
+
+import javax.annotation.Priority;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.Configuration;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.impl.WebAppContextWrapper;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.util.ThreadLocalsHolder;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.MDC;
import org.springframework.web.context.WebApplicationContext;
-import javax.annotation.Priority;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.ContainerResponseContext;
-import javax.ws.rs.container.ContainerResponseFilter;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.Provider;
-import java.io.IOException;
-import java.util.UUID;
+import com.google.gson.GsonBuilder;
@Provider
@Priority(1)
package org.openecomp.sdc.be.filters;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Priority;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.ResponseBuilder;
+import javax.ws.rs.core.Response.Status;
+
import org.openecomp.sdc.be.components.health.HealthCheckBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.annotation.Priority;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.Response.Status;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
@Priority(11)
public class ComponentsAvailabilityFilter implements ContainerRequestFilter {
package org.openecomp.sdc.be.impl;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-import fj.data.Either;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
import org.openecomp.sdc.be.auditing.impl.AuditAuthRequestEventFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.servlet.http.HttpServletRequest;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.List;
-import java.util.Map;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.reflect.TypeToken;
+
+import fj.data.Either;
@org.springframework.stereotype.Component("componentUtils")
public class ComponentsUtils {
package org.openecomp.sdc.be.impl;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpStatus;
import org.eclipse.jgit.util.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.StreamingOutput;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import fj.data.Either;
public class DownloadArtifactLogic {
package org.openecomp.sdc.be.impl;
-import com.google.common.collect.HashMultimap;
-import com.google.common.collect.SetMultimap;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.javatuples.Pair;
import org.openecomp.sdc.be.components.impl.ResponseFormatManager;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Service;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.SetMultimap;
+
public class ForwardingPathUtils {
public static final String FORWARDING_PATH_NODE_NAME = "Forwarding Path";
package org.openecomp.sdc.be.impl;
-import com.google.gson.Gson;
+import javax.annotation.Resource;
+
import org.openecomp.sdc.be.user.IUserBusinessLogic;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
+import com.google.gson.Gson;
@Component("servletUtils")
public class ServletUtils {
package org.openecomp.sdc.be.impl;
+import javax.servlet.ServletContext;
+
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
-import javax.servlet.ServletContext;
-
public class WebAppContextWrapper {
public WebApplicationContext getWebAppContext(ServletContext context) {
package org.openecomp.sdc.be.info;
-import com.google.gson.Gson;
-import com.google.gson.JsonObject;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.config.Configuration.ArtifactTypeConfig;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.*;
+import com.google.gson.Gson;
+import com.google.gson.JsonObject;
+
+import fj.data.Either;
public class ArtifactTemplateInfo {
public static final String TYPE = "type";
package org.openecomp.sdc.be.info;
-import org.openecomp.sdc.be.model.ArtifactType;
-
import java.util.List;
+import org.openecomp.sdc.be.model.ArtifactType;
+
public class ArtifactTypesInfo {
Integer heatDefaultTimeout = 60;
package org.openecomp.sdc.be.info;
+import java.util.List;
+
import org.openecomp.sdc.be.model.GroupDefinition;
import org.openecomp.sdc.be.model.GroupInstance;
import org.openecomp.sdc.be.model.GroupProperty;
-import java.util.List;
-
public class GroupDefinitionInfo {
private String name;
package org.openecomp.sdc.be.info;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.model.ArtifactDefinition;
-
-import java.util.*;
public class MergedArtifactInfo {
private List<ArtifactDefinition> createdArtifact;
package org.openecomp.sdc.be.info;
-import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
+import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+
public class NodeTypeInfoToUpdateArtifacts {
private String nodeName;
package org.openecomp.sdc.be.info;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
public final class OperationalEnvInfo {
@JsonIgnore
package org.openecomp.sdc.be.info;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
import java.util.ArrayList;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
public final class Relationship {
@JsonProperty("related-to")
package org.openecomp.sdc.be.mixin;
-import com.fasterxml.jackson.annotation.JsonProperty;
import org.openecomp.sdc.be.datatypes.elements.GroupTypeDataDefinition;
import org.openecomp.sdc.be.view.Mixin;
import org.openecomp.sdc.be.view.MixinTarget;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
@MixinTarget(target = GroupTypeDataDefinition.class)
public abstract class GroupTypeMixin extends Mixin {
package org.openecomp.sdc.be.mixin;
-import com.fasterxml.jackson.annotation.JsonProperty;
import org.openecomp.sdc.be.datatypes.elements.PolicyTypeDataDefinition;
import org.openecomp.sdc.be.view.Mixin;
import org.openecomp.sdc.be.view.MixinTarget;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
@MixinTarget(target = PolicyTypeDataDefinition.class)
public abstract class PolicyTypeMixin extends Mixin {
package org.openecomp.sdc.be.monitoring;
+import java.net.URI;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.api.Response;
import org.eclipse.jetty.proxy.ProxyServlet;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.net.URI;
-
public class EsGateway extends ProxyServlet {
private static final long serialVersionUID = 1L;
package org.openecomp.sdc.be.servlets;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import com.google.gson.JsonSyntaxException;
-import fj.data.Either;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Supplier;
+import java.util.zip.ZipInputStream;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.context.WebApplicationContext;
import org.yaml.snakeyaml.Yaml;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Type;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Supplier;
-import java.util.zip.ZipInputStream;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.JsonSyntaxException;
+
+import fj.data.Either;
public abstract class AbstractValidationsServlet extends BeGenericServlet {
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.AdditionalInformationBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.WebAppContextWrapper;
import org.openecomp.sdc.be.model.AdditionalInformationDefinition;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
@Api(value = "Additional Information Servlet", description = "Additional Information Servlet")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
-import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum;
-import org.openecomp.sdc.be.config.BeEcompErrorManager;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
-import org.openecomp.sdc.be.model.Operation;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.exception.ResponseFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.Map;
import javax.inject.Singleton;
import javax.servlet.ServletContext;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import java.util.Map;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
+import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum;
+import org.openecomp.sdc.be.config.BeEcompErrorManager;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.Operation;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.exception.ResponseFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* Root resource (exposed at "/" path)
*/
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.AttributeBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* Web Servlet for actions on Attributes
*
package org.openecomp.sdc.be.servlets;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import fj.data.Either;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.function.Supplier;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.ResponseBuilder;
+
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.function.Supplier;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+
+import fj.data.Either;
public class BeGenericServlet extends BasicServlet {
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.util.List;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.lang3.tuple.Pair;
import org.openecomp.sdc.be.components.health.HealthCheckBusinessLogic;
import org.openecomp.sdc.be.components.impl.MonitoringBusinessLogic;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.api.HealthCheckInfo;
import org.openecomp.sdc.common.api.HealthCheckWrapper;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.monitoring.MonitoringEvent;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.List;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.TRACE, trim = false)
@Path("/")
@Api(value = "BE Monitoring", description = "BE Monitoring")
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
import org.openecomp.sdc.be.components.impl.exceptions.ComponentException;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.stereotype.Component;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Provider;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
@Component
@Provider
package org.openecomp.sdc.be.servlets;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.io.InputStream;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.InputStream;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.reflect.TypeToken;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* Root resource (exposed at "/" path) .json
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.List;
-import java.util.Map;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
@Api(value = "Component Servlet", description = "Component Servlet")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+
import org.openecomp.sdc.be.config.Configuration;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.common.api.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
+import com.jcabi.aspects.Loggable;
/**
* Root resource (exposed at "/" path)
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import org.openecomp.sdc.be.config.Configuration;
-import org.openecomp.sdc.common.api.ConfigurationSource;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.servlets.BasicServlet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
+import org.openecomp.sdc.be.config.Configuration;
+import org.openecomp.sdc.common.api.ConfigurationSource;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.servlets.BasicServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.jcabi.aspects.Loggable;
+
/**
* Root resource (exposed at "/" path)
*/
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.ConsumerBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import com.google.gson.Gson;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/consumers")
@Api(value = "Consumer Servlet", description = "Consumer Servlet")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import org.openecomp.sdc.be.resources.data.ESArtifactData;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
+import org.openecomp.sdc.be.resources.data.ESArtifactData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.jcabi.aspects.Loggable;
+
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/services")
public class CsarBuildServlet extends ToscaDaoServlet {
package org.openecomp.sdc.be.servlets;
-import org.eclipse.jetty.http.HttpStatus;
-import org.springframework.stereotype.Component;
-
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
+import org.eclipse.jetty.http.HttpStatus;
+import org.springframework.stereotype.Component;
+
@Component
@Provider
public class DefaultExceptionMapper implements ExceptionMapper<Exception> {
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import javax.annotation.Resource;
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.DistributionMonitoringBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.info.DistributionStatusListResponse;
import org.openecomp.sdc.be.info.DistributionStatusOfServiceListResponce;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* Root resource (exposed at "/" path)
*/
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.ElementBusinessLogic;
import org.openecomp.sdc.be.components.scheduledtasks.ComponentsCleanBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.openecomp.sdc.be.info.ArtifactTypesInfo;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.ArtifactType;
+import org.openecomp.sdc.be.model.Category;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.PropertyScope;
import org.openecomp.sdc.be.model.Tag;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.catalog.CatalogComponent;
import org.openecomp.sdc.be.model.category.CategoryDefinition;
import org.openecomp.sdc.be.model.category.GroupingDefinition;
import org.openecomp.sdc.be.ui.model.UiCategories;
import org.openecomp.sdc.be.user.UserBusinessLogic;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Path("/v1/")
package org.openecomp.sdc.be.servlets;
-import com.google.common.reflect.TypeToken;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.openecomp.sdc.be.components.impl.GroupBusinessLogic;
-import org.openecomp.sdc.be.config.BeEcompErrorManager;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.info.GroupDefinitionInfo;
-import org.openecomp.sdc.be.model.GroupDefinition;
-import org.openecomp.sdc.be.model.GroupProperty;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.exception.ResponseFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.List;
import javax.inject.Singleton;
import javax.servlet.ServletContext;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import java.util.List;
+
+import org.openecomp.sdc.be.components.impl.GroupBusinessLogic;
+import org.openecomp.sdc.be.config.BeEcompErrorManager;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.info.GroupDefinitionInfo;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.GroupProperty;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.exception.ResponseFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.reflect.TypeToken;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* Root resource (exposed at "/" path)
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.openecomp.sdc.be.components.impl.GroupTypeBusinessLogic;
-import org.openecomp.sdc.be.mixin.GroupTypeMixin;
-import org.openecomp.sdc.be.model.GroupTypeDefinition;
-import org.openecomp.sdc.be.view.ResponseView;
-import org.openecomp.sdc.common.api.Constants;
-import org.springframework.stereotype.Controller;
+import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
-import java.util.List;
+
+import org.openecomp.sdc.be.components.impl.GroupTypeBusinessLogic;
+import org.openecomp.sdc.be.mixin.GroupTypeMixin;
+import org.openecomp.sdc.be.model.GroupTypeDefinition;
+import org.openecomp.sdc.be.view.ResponseView;
+import org.openecomp.sdc.common.api.Constants;
+import org.springframework.stereotype.Controller;
+
+import com.jcabi.aspects.Loggable;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
package org.openecomp.sdc.be.servlets;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.InputsBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.Arrays;
-import java.util.List;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Api(value = "Input Catalog", description = "Input Servlet")
@Path("/v1/catalog")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic;
import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoBase;
import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.be.ui.model.UiComponentMetadata;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
@Api(value = "Lifecycle Actions Servlet", description = "Lifecycle Actions Servlet")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.components.impl.PolicyBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.impl.ServletUtils;
import org.openecomp.sdc.be.model.PolicyDefinition;
+import org.openecomp.sdc.be.model.PolicyTargetDTO;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-
-import org.openecomp.sdc.be.model.PolicyTargetDTO;
+import com.jcabi.aspects.Loggable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* Provides REST API to create, retrieve, update, delete a policy
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.PolicyTypeBusinessLogic;
import org.openecomp.sdc.be.mixin.PolicyTypeMixin;
import org.openecomp.sdc.be.model.PolicyTypeDefinition;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import com.jcabi.aspects.Loggable;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.util.Map;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.ProductBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.Product;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.Map;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder;
import org.openecomp.sdc.be.resources.data.EntryData;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.lang.reflect.Type;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.reflect.TypeToken;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
@Api(value = "Resource Property Servlet", description = "Resource Property Servlet")
package org.openecomp.sdc.be.servlets;
-import com.fasterxml.jackson.annotation.JsonFilter;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.SerializeExceptFilter;
-import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
-import com.google.common.collect.ImmutableMap;
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.datatypes.elements.InterfaceOperationDataDefinition;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.fasterxml.jackson.annotation.JsonFilter;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.SerializeExceptFilter;
+import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
+import com.google.common.collect.ImmutableMap;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+
public class RepresentationUtils {
private static final Logger log = LoggerFactory.getLogger(RepresentationUtils.class);
package org.openecomp.sdc.be.servlets;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.exception.ResponseFormat;
import com.jcabi.aspects.Loggable;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
public class RequirementsServlet extends BeGenericServlet {
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.http.HttpStatus;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog/resources/available")
package org.openecomp.sdc.be.servlets;
-import com.google.common.collect.Sets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.UUID;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.components.impl.InterfaceOperationBusinessLogic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.UUID;
+import com.google.common.collect.Sets;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog/resources/{resourceId}/interfaceOperations")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import io.swagger.annotations.*;
+import java.io.File;
+
+import javax.annotation.Resource;
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
import org.openecomp.sdc.be.model.UploadResourceInfo;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.File;
+import com.jcabi.aspects.Loggable;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
/**
* Root resource (exposed at "/" path)
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.http.HttpStatus;
import org.json.JSONObject;
import org.openecomp.sdc.be.components.impl.CsarValidationUtils;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.be.servlets.ResourceUploadServlet.ResourceAuthorityTypeEnum;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
@Api(value = "Resources Catalog", description = "Resources Servlet")
package org.openecomp.sdc.be.servlets;
-import com.google.common.collect.Sets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
import java.util.Collections;
import java.util.Set;
+
import javax.inject.Singleton;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.collect.Sets;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog/services/{serviceId}/paths")
@Consumes(MediaType.APPLICATION_JSON)
package org.openecomp.sdc.be.servlets;
-import com.google.gson.reflect.TypeToken;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.*;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.http.HttpStatus;
-import com.fasterxml.jackson.databind.ObjectMapper;
import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic;
import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datamodel.ServiceRelations;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.GroupInstanceProperty;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.reflect.TypeToken;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.model.operations.StorageException;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.stereotype.Component;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Provider;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
@Component
@Provider
package org.openecomp.sdc.be.servlets;
+import javax.servlet.ServletContext;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.impl.DownloadArtifactLogic;
import org.openecomp.sdc.be.impl.WebAppContextWrapper;
import org.openecomp.sdc.be.info.ServletJsonResponse;
import org.openecomp.sdc.be.resources.api.IResourceUploader;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.slf4j.Logger;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.ws.rs.core.Response;
-
public abstract class ToscaDaoServlet extends BeGenericServlet {
public abstract Logger getLogger();
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.util.Map;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.openecomp.sdc.be.components.impl.PropertyBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.DataTypeDefinition;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.inject.Singleton;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.Map;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
@Api(value = "Types Fetch Servlet", description = "Types Fetch Servlet")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.glassfish.jersey.media.multipart.FormDataParam;
import org.openecomp.sdc.be.components.impl.CapabilityTypeImportManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog/uploadType")
@Api(value = "Catalog Types Upload")
package org.openecomp.sdc.be.servlets;
-import com.jcabi.aspects.Loggable;
-import fj.data.Either;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.openecomp.sdc.be.config.BeEcompErrorManager;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.user.UserBusinessLogic;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.exception.ResponseFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.List;
import javax.inject.Singleton;
import javax.servlet.ServletContext;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.List;
+
+import org.openecomp.sdc.be.config.BeEcompErrorManager;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.user.UserBusinessLogic;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.exception.ResponseFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.jcabi.aspects.Loggable;
+
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/user")
@Api(value = "User Administration", description = "User admininstarator operations")
package org.openecomp.sdc.be.switchover.detector;
+import java.net.InetAddress;
+import java.util.Properties;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
import org.apache.commons.codec.binary.Base64;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import java.net.InetAddress;
-import java.util.Properties;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-
@Component("switchover-detector")
public class SwitchoverDetector {
package org.openecomp.sdc.be.tosca;
-import org.onap.sdc.generator.data.ArtifactType;
-
import java.util.List;
+import org.onap.sdc.generator.data.ArtifactType;
+
public class ArtifactTypes {
private List<ArtifactType> artifactTypes;
package org.openecomp.sdc.be.tosca;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import fj.data.Either;
+import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isNoneBlank;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.ComponentParametersView;
+import org.openecomp.sdc.be.model.DataTypeDefinition;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.RequirementDefinition;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.jsontitan.utils.ModelConverter;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.tosca.ToscaUtils.SubstituitionEntry;
-import org.openecomp.sdc.be.tosca.model.*;
+import org.openecomp.sdc.be.tosca.model.SubstitutionMapping;
+import org.openecomp.sdc.be.tosca.model.ToscaCapability;
+import org.openecomp.sdc.be.tosca.model.ToscaNodeTemplate;
+import org.openecomp.sdc.be.tosca.model.ToscaNodeType;
+import org.openecomp.sdc.be.tosca.model.ToscaProperty;
+import org.openecomp.sdc.be.tosca.model.ToscaRequirement;
+import org.openecomp.sdc.be.tosca.model.ToscaTemplateCapability;
import org.openecomp.sdc.common.util.ValidationUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
-import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
-import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
-import static org.apache.commons.lang3.StringUtils.*;
+import fj.data.Either;
/**
* Allows to convert requirements\capabilities of a component to requirements\capabilities of a substitution mappings section of a tosca template
package org.openecomp.sdc.be.tosca;
-import com.google.gson.Gson;
-import fj.data.Either;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
+
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.ImmutableTriple;
import org.apache.commons.lang3.tuple.Triple;
+import org.onap.sdc.generator.data.AdditionalParams;
+import org.onap.sdc.generator.data.Artifact;
+import org.onap.sdc.generator.data.ArtifactType;
+import org.onap.sdc.generator.data.GenerationData;
+import org.onap.sdc.generator.impl.ArtifactGenerationServiceImpl;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationInfo;
import org.openecomp.sdc.common.util.GeneralUtility;
import org.openecomp.sdc.common.util.ValidationUtils;
import org.openecomp.sdc.exception.ResponseFormat;
-import org.onap.sdc.generator.data.AdditionalParams;
-import org.onap.sdc.generator.data.Artifact;
-import org.onap.sdc.generator.data.ArtifactType;
-import org.onap.sdc.generator.data.GenerationData;
-import org.onap.sdc.generator.impl.ArtifactGenerationServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import com.google.gson.Gson;
+
+import fj.data.Either;
+
/**
* @author tg851x
import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.addInterfaceDefinitionElement;
import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.addInterfaceTypeElement;
-import fj.data.Either;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Set;
import java.util.function.Supplier;
import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.yaml.snakeyaml.representer.Represent;
import org.yaml.snakeyaml.representer.Representer;
+import fj.data.Either;
+
@org.springframework.stereotype.Component("tosca-export-handler")
public class ToscaExportHandler {
package org.openecomp.sdc.be.tosca;
+import java.util.List;
+
import org.apache.commons.lang3.tuple.Triple;
import org.openecomp.sdc.be.model.Component;
-import java.util.List;
-
public class ToscaRepresentation {
private String mainYaml;
package org.openecomp.sdc.be.tosca;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.Component;
-import java.lang.reflect.Field;
-import java.util.*;
-
public class ToscaUtils {
public static boolean isComplexVfc(Component component) {
import java.util.List;
import java.util.Map;
+
import org.apache.commons.lang3.tuple.Triple;
import org.openecomp.sdc.be.model.Component;
package org.openecomp.sdc.be.tosca.utils;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
import org.openecomp.sdc.be.tosca.model.ToscaNodeTemplate;
import org.openecomp.sdc.be.tosca.model.ToscaTemplateRequirement;
-import java.util.*;
+import fj.data.Either;
/**
* @author KATYR
package org.openecomp.sdc.be.tosca.utils;
-import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
+
import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.tosca.model.ToscaNodeType;
import org.openecomp.sdc.be.tosca.model.ToscaProperty;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
/**
* @author KATYR
* @since March 20, 2018
package org.openecomp.sdc.be.tosca.utils;
import java.io.File;
+
import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
import org.openecomp.sdc.be.tosca.CsarUtils;
package org.openecomp.sdc.be.user;
-import fj.data.Either;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.exception.ResponseFormat;
-import javax.servlet.ServletContext;
-import java.util.List;
+import fj.data.Either;
/**
*
package org.openecomp.sdc.be.user;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.servlet.ServletContext;
+
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.common.api.UserRoleEnum;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.kpi.api.ASDCKpiApi;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
@Component("userBusinessLogic")
public class UserBusinessLogic implements IUserBusinessLogic {
package org.openecomp.sdc.be.view;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
/**
* A class that is then responsible for converting a message payload with a dedicated mixin from an instance of a specific Java type into a json representation.
*/
package org.openecomp.sdc.common.transaction.api;
-import fj.data.Either;
import org.openecomp.sdc.be.resources.data.ESArtifactData;
import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBActionCodeEnum;
import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBTypeEnum;
import org.openecomp.sdc.common.transaction.api.TransactionUtils.ESActionTypeEnum;
import org.openecomp.sdc.common.transaction.api.TransactionUtils.TransactionCodeEnum;
+import fj.data.Either;
+
public interface ITransactionSdnc {
TransactionCodeEnum finishTransaction();
package org.openecomp.sdc.common.transaction.api;
+import java.util.Stack;
+
import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBActionCodeEnum;
import org.openecomp.sdc.common.transaction.api.TransactionUtils.LogMessages;
import org.openecomp.sdc.common.util.MethodActivationStatusEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Stack;
-
public abstract class RollbackHandler implements IDBType {
// TODO test using slf4j-test and make this final
package org.openecomp.sdc.common.transaction.impl;
-import fj.data.Either;
import org.openecomp.sdc.be.dao.api.ResourceUploadStatus;
import org.openecomp.sdc.be.dao.impl.ESCatalogDAO;
import org.openecomp.sdc.be.resources.data.ESArtifactData;
-import org.openecomp.sdc.be.resources.exception.ResourceDAOException;
import org.openecomp.sdc.be.tosca.CsarUtils;
import org.openecomp.sdc.common.transaction.api.RollbackHandler;
import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBActionCodeEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import fj.data.Either;
+
public class ESRollbackHandler extends RollbackHandler {
private static final Logger log = LoggerFactory.getLogger(CsarUtils.class);
package org.openecomp.sdc.common.transaction.mngr;
+import java.util.List;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
-import org.openecomp.sdc.common.config.EcompErrorName;
import org.openecomp.sdc.common.transaction.api.ICommitHandler;
import org.openecomp.sdc.common.transaction.api.TransactionUtils;
import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBActionCodeEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.List;
-
public class CommitManager {
// TODO test using slf4j-test and make this final
package org.openecomp.sdc.common.transaction.mngr;
-import com.google.common.collect.EvictingQueue;
-import com.google.common.collect.Queues;
+import java.util.Queue;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.annotation.Resource;
+
import org.openecomp.sdc.be.dao.impl.ESCatalogDAO;
import org.openecomp.sdc.be.dao.titan.TitanGenericDao;
import org.openecomp.sdc.common.transaction.api.ITransactionSdnc;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import java.util.Queue;
-import java.util.concurrent.atomic.AtomicInteger;
+import com.google.common.collect.EvictingQueue;
+import com.google.common.collect.Queues;
@Component("transactionManager")
public class TransactionManager {
package org.openecomp.sdc.common.transaction.mngr;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.List;
+
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.impl.ESCatalogDAO;
import org.openecomp.sdc.be.dao.titan.TitanGenericDao;
import org.openecomp.sdc.be.resources.data.ESArtifactData;
-import org.openecomp.sdc.common.config.EcompErrorName;
-import org.openecomp.sdc.common.transaction.api.*;
-import org.openecomp.sdc.common.transaction.api.TransactionUtils.*;
+import org.openecomp.sdc.common.transaction.api.ICommitHandler;
+import org.openecomp.sdc.common.transaction.api.IDBAction;
+import org.openecomp.sdc.common.transaction.api.ITransactionSdnc;
+import org.openecomp.sdc.common.transaction.api.RollbackHandler;
+import org.openecomp.sdc.common.transaction.api.TransactionUtils;
+import org.openecomp.sdc.common.transaction.api.TransactionUtils.ActionTypeEnum;
+import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBActionCodeEnum;
+import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBTypeEnum;
+import org.openecomp.sdc.common.transaction.api.TransactionUtils.ESActionTypeEnum;
+import org.openecomp.sdc.common.transaction.api.TransactionUtils.LogMessages;
+import org.openecomp.sdc.common.transaction.api.TransactionUtils.TransactionCodeEnum;
+import org.openecomp.sdc.common.transaction.api.TransactionUtils.TransactionStatusEnum;
import org.openecomp.sdc.common.transaction.impl.ESAction;
import org.openecomp.sdc.common.transaction.impl.ESRollbackHandler;
import org.openecomp.sdc.common.transaction.impl.TitanCommitHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-import java.util.List;
+import fj.data.Either;
public class TransactionSdncImpl implements ITransactionSdnc {
package org.openecomp.sdc;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.graph.datatype.GraphNode;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.resources.data.CategoryData;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import fj.data.Either;
public class ElementOperationMock implements IElementOperation {
package org.openecomp.sdc;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.config.ErrorConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.File;
-
-import static org.junit.Assert.assertTrue;
-
public class ErrorConfigurationTest {
ConfigurationSource configurationSource = null;
private static final Logger log = LoggerFactory.getLogger(ErrorConfigurationTest.class);
package org.openecomp.sdc;
+import java.io.IOException;
+
import org.openecomp.sdc.be.config.Configuration;
import org.openecomp.sdc.common.api.BasicConfiguration;
import org.openecomp.sdc.common.api.ConfigurationListener;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
-import java.io.IOException;
-
public class TestExternalConfiguration<T extends Object> {
public static void main(String[] args) throws IOException {
package org.openecomp.sdc;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.io.output.ByteArrayOutputStream;
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.output.ByteArrayOutputStream;
+
public class ZipUtil {
public static void main(String[] args) {
package org.openecomp.sdc.be;
+import static org.mockito.Mockito.mock;
+
import org.openecomp.sdc.be.config.Configuration;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.config.DistributionEngineConfiguration;
import org.openecomp.sdc.common.api.ConfigurationListener;
import org.openecomp.sdc.common.api.ConfigurationSource;
-import static org.mockito.Mockito.mock;
-
public class DummyConfigurationManager {
private DistributionEngineConfiguration distributionConfigurationMock = mock(DistributionEngineConfiguration.class);
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+
+public class AuditAuthRequestEventFactoryTest {
+
+ private AuditAuthRequestEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditAuthRequestEventFactory(build, "mock", "mock", "mock", "mock");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditAuthRequestEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditAuthRequestEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.auditing.impl;
-import org.junit.Test;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.common.api.Constants;
-
import static org.junit.Assert.assertEquals;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.DESIGNER_USER_ROLE;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.USER_EMAIL;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.USER_LAST_NAME;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.USER_UID;
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.common.api.Constants;
+
public class AuditBaseEventFactoryTest {
private User user = new User();
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.sdc.be.model.ConsumerDefinition;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+
+import mockit.Deencapsulation;
+
+public class AuditConsumerEventFactoryTest {
+
+ private AuditConsumerEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditConsumerEventFactory(AuditingActionEnum.ACTIVATE_SERVICE_BY_API, build, new User(),
+ new ConsumerDefinition());
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditConsumerEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditConsumerEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testBuildConsumerName() throws Exception {
+ ConsumerDefinition consumer = null;
+ String result;
+
+ // test 1
+ consumer = null;
+ result = Deencapsulation.invoke(AuditConsumerEventFactory.class, "buildConsumerName",
+ new Object[] { ConsumerDefinition.class });
+ Assert.assertEquals("", result);
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.auditing.impl;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
-import org.openecomp.sdc.be.config.Configuration;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
-import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
-import org.openecomp.sdc.be.dao.impl.AuditingDao;
-import org.openecomp.sdc.be.model.ConsumerDefinition;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
-import org.openecomp.sdc.be.resources.data.auditing.ConsumerEvent;
-import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
-import org.openecomp.sdc.common.util.ThreadLocalsHolder;
-
-import java.util.EnumMap;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.modifier;
+import java.util.EnumMap;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
+import org.openecomp.sdc.be.config.Configuration;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
+import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
+import org.openecomp.sdc.be.dao.impl.AuditingDao;
+import org.openecomp.sdc.be.model.ConsumerDefinition;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.ConsumerEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.openecomp.sdc.common.util.ThreadLocalsHolder;
+
@RunWith(MockitoJUnitRunner.class)
public class AuditConsumerEventFuncTest {
private AuditingManager auditingManager;
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+
+public class AuditEcompOpEnvEventFactoryTest {
+
+ private AuditEcompOpEnvEventFactory createTestSubject() {
+ return new AuditEcompOpEnvEventFactory(AuditingActionEnum.ACTIVATE_SERVICE_BY_API, "", "", "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditEcompOpEnvEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditEcompOpEnvEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditResourceEventFactoryManangerTest {
+
+ private AuditResourceEventFactoryMananger createTestSubject() {
+ return new AuditResourceEventFactoryMananger();
+ }
+
+ @Test
+ public void testCreateResourceEventFactory() throws Exception {
+ AuditingActionEnum action = null;
+ CommonAuditData commonFields = null;
+ ResourceAuditData prevParams = null;
+ ResourceAuditData currParams = null;
+ String resourceType = "";
+ String resourceName = "";
+ String invariantUuid = "";
+ User modifier = null;
+ String artifactData = "";
+ String comment = "";
+ String did = "";
+ String toscaNodeType = "";
+ AuditBaseEventFactory result;
+
+ for (AuditingActionEnum iterable_element : AuditingActionEnum.values()) {
+ try {
+ result = AuditResourceEventFactoryMananger.createResourceEventFactory(iterable_element, commonFields, prevParams,
+ currParams, resourceType, resourceName, invariantUuid, modifier, artifactData, comment, did,
+ toscaNodeType);
+ } catch (Exception UnsupportedOperationException) {
+ continue;
+ }
+ }
+ // default test
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+
+import mockit.Deencapsulation;
+
+public class AuditingLogFormatUtilTest {
+
+ private AuditingLogFormatUtil createTestSubject() {
+ return new AuditingLogFormatUtil();
+ }
+
+ @Test
+ public void testGetModifier() throws Exception {
+ String modifierName = "mock";
+ String modifierUid = "mock";
+ String result;
+
+ // test 0
+ result = Deencapsulation.invoke(AuditingLogFormatUtil.class, "getModifier",
+ new Object[] { modifierName, modifierUid });
+ Assert.assertEquals("mock(mock)", result);
+
+ // test 1
+ result = Deencapsulation.invoke(AuditingLogFormatUtil.class, "getModifier",
+ new Object[] { modifierName, String.class });
+ Assert.assertEquals("", result);
+
+ // test 2
+ modifierUid = "";
+ result = Deencapsulation.invoke(AuditingLogFormatUtil.class, "getModifier",
+ new Object[] { modifierName, modifierUid });
+ Assert.assertEquals("", result);
+
+ // test 3
+ result = Deencapsulation.invoke(AuditingLogFormatUtil.class, "getModifier",
+ new Object[] { String.class, modifierUid });
+ Assert.assertEquals("", result);
+
+ // test 4
+ modifierName = "";
+ result = Deencapsulation.invoke(AuditingLogFormatUtil.class, "getModifier",
+ new Object[] { modifierName, modifierUid });
+ Assert.assertEquals("", result);
+ }
+
+ @Test
+ public void testGetUser() throws Exception {
+ String userData = "";
+ String result;
+
+ // default test
+ result = Deencapsulation.invoke(AuditingLogFormatUtil.class, "getUser", new Object[] { userData });
+ }
+
+ @Test
+ public void testLogAuditEvent() throws Exception {
+ Map<AuditingFieldsKeysEnum, Object> auditingFields = null;
+ String result;
+
+ // default test
+ HashMap<AuditingFieldsKeysEnum, Object> hashMap = new HashMap<AuditingFieldsKeysEnum, Object>();
+ result = Deencapsulation.invoke(AuditingLogFormatUtil.class, "logAuditEvent",
+ new Object[] { hashMap.getClass() });
+ }
+
+ @Test
+ public void testLogAuditEvent_1() throws Exception {
+ String formattedString = "";
+ Map<AuditingFieldsKeysEnum, Object> auditingFields = new HashMap<>();
+
+ // default test
+ Deencapsulation.invoke(AuditingLogFormatUtil.class, "logAuditEvent", new Object[] { formattedString });
+
+ auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_NAME, "mock");
+ Deencapsulation.invoke(AuditingLogFormatUtil.class, "logAuditEvent", auditingFields);
+
+ for ( AuditingFieldsKeysEnum enumValue : AuditingFieldsKeysEnum.values()) {
+ auditingFields.put(enumValue, "mock");
+ }
+
+ Deencapsulation.invoke(AuditingLogFormatUtil.class, "logAuditEvent", auditingFields);
+
+ auditingFields = new HashMap<>();
+ for (AuditingActionEnum iterable_element : AuditingActionEnum.values()) {
+ auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, iterable_element.getName());
+ Deencapsulation.invoke(AuditingLogFormatUtil.class, "logAuditEvent", auditingFields);
+ }
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.auditing.impl.category;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyMap;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.CATEGORY;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.DESCRIPTION;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.EXPECTED_ADD_CATEGORY_LOG_STR;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.GROUPING_NAME;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.MODIFIER_UID;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.REQUEST_ID;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.RESOURCE_TYPE;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.SERVICE_INSTANCE_ID;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.STATUS_OK;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.SUB_CATEGORY;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.modifier;
+
+import java.util.EnumMap;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
import org.openecomp.sdc.common.util.ThreadLocalsHolder;
-import java.util.EnumMap;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyMap;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.CATEGORY;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.DESCRIPTION;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.EXPECTED_ADD_CATEGORY_LOG_STR;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.GROUPING_NAME;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.MODIFIER_UID;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.REQUEST_ID;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.RESOURCE_TYPE;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.SERVICE_INSTANCE_ID;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.STATUS_OK;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.SUB_CATEGORY;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.modifier;
-
@RunWith(MockitoJUnitRunner.class)
public class AuditCategoryEventFuncTest {
private AuditingManager auditingManager;
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.category;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+
+public class AuditGetCategoryHierarchyEventFactoryTest {
+
+ private AuditGetCategoryHierarchyEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditGetCategoryHierarchyEventFactory(AuditingActionEnum.ACTIVATE_SERVICE_BY_API, build,
+ new User(), "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditGetCategoryHierarchyEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditGetCategoryHierarchyEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.distribution;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+
+public class AuditCreateTopicDistribEngineEventFactoryTest {
+
+ private AuditCreateTopicDistribEngineEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditCreateTopicDistribEngineEventFactory(build, "", "", "", "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditCreateTopicDistribEngineEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.auditing.impl.distribution;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
-import org.openecomp.sdc.be.auditing.impl.AuditingManager;
-import org.openecomp.sdc.be.config.Configuration;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
-import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
-import org.openecomp.sdc.be.dao.impl.AuditingDao;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
-import org.openecomp.sdc.be.resources.data.auditing.DistributionEngineEvent;
-import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
-import org.openecomp.sdc.common.util.ThreadLocalsHolder;
-
-import java.util.EnumMap;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.STATUS_OK;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
+import java.util.EnumMap;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
+import org.openecomp.sdc.be.auditing.impl.AuditingManager;
+import org.openecomp.sdc.be.config.Configuration;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
+import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
+import org.openecomp.sdc.be.dao.impl.AuditingDao;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.DistributionEngineEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.openecomp.sdc.common.util.ThreadLocalsHolder;
+
@RunWith(MockitoJUnitRunner.class)
public class AuditDistrEngineFuncTest {
private AuditingManager auditingManager;
package org.openecomp.sdc.be.auditing.impl.distribution;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
-import org.openecomp.sdc.be.auditing.impl.AuditingManager;
-import org.openecomp.sdc.be.config.Configuration;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
-import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
-import org.openecomp.sdc.be.dao.impl.AuditingDao;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingGetUebClusterEvent;
-import org.openecomp.sdc.be.resources.data.auditing.DistributionDeployEvent;
-import org.openecomp.sdc.be.resources.data.auditing.DistributionDownloadEvent;
-import org.openecomp.sdc.be.resources.data.auditing.DistributionNotificationEvent;
-import org.openecomp.sdc.be.resources.data.auditing.DistributionStatusEvent;
-import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
-import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
-import org.openecomp.sdc.be.resources.data.auditing.model.OperationalEnvAuditData;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
-import org.openecomp.sdc.common.util.ThreadLocalsHolder;
-
-import java.util.EnumMap;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.user;
+import java.util.EnumMap;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
+import org.openecomp.sdc.be.auditing.impl.AuditingManager;
+import org.openecomp.sdc.be.config.Configuration;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
+import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
+import org.openecomp.sdc.be.dao.impl.AuditingDao;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGetUebClusterEvent;
+import org.openecomp.sdc.be.resources.data.auditing.DistributionDeployEvent;
+import org.openecomp.sdc.be.resources.data.auditing.DistributionDownloadEvent;
+import org.openecomp.sdc.be.resources.data.auditing.DistributionNotificationEvent;
+import org.openecomp.sdc.be.resources.data.auditing.DistributionStatusEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
+import org.openecomp.sdc.be.resources.data.auditing.model.OperationalEnvAuditData;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.openecomp.sdc.common.util.ThreadLocalsHolder;
+
@RunWith(MockitoJUnitRunner.class)
public class AuditDistrEventFuncTest {
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.distribution;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+
+public class AuditDistribDeployEventFactoryTest {
+
+ private AuditDistribDeployEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditDistribDeployEventFactory(build, "", "", new User(), "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditDistribDeployEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditDistribDeployEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.distribution;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
+
+public class AuditDistribDownloadEventFactoryTest {
+
+ private AuditDistribDownloadEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditDistribDownloadEventFactory(build, new DistributionData("", ""));
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditDistribDownloadEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditDistribDownloadEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.distribution;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+import org.openecomp.sdc.be.resources.data.auditing.model.OperationalEnvAuditData;
+
+public class AuditDistribNotificationEventFactoryTest {
+
+ private AuditDistribNotificationEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditDistribNotificationEventFactory(build, "", "", "", new User(), "", "", "",
+ new OperationalEnvAuditData("", "", ""));
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditDistribNotificationEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditDistribNotificationEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.distribution;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+
+public class AuditDistribStatusEventFactoryTest {
+
+ private AuditDistribStatusEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditDistribStatusEventFactory(build, "", "", "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditDistribStatusEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditDistribStatusEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.distribution;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+
+public class AuditGetUebClusterEventFactoryTest {
+
+ private AuditGetUebClusterEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData build = newBuilder.build();
+ return new AuditGetUebClusterEventFactory(build, "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditGetUebClusterEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditGetUebClusterEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.auditing.impl.ecompopenv;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyMap;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.EXPECTED_CREATE_OP_ENV_LOG_STR;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.EXPECTED_UNKNOWN_NOTIFICATION_OP_ENV_LOG_STR;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.EXPECTED_UNSUPPORTED_TYPE_OP_ENV_LOG_STR;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.OP_ENV_ACTION;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.OP_ENV_ID;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.OP_ENV_NAME;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.OP_ENV_TYPE;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.TENANT_CONTEXT;
+import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
+
+import java.util.EnumMap;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.resources.data.auditing.EcompOperationalEnvironmentEvent;
import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
-import java.util.EnumMap;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyMap;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.EXPECTED_CREATE_OP_ENV_LOG_STR;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.EXPECTED_UNKNOWN_NOTIFICATION_OP_ENV_LOG_STR;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.EXPECTED_UNSUPPORTED_TYPE_OP_ENV_LOG_STR;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.OP_ENV_ACTION;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.OP_ENV_ID;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.OP_ENV_NAME;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.OP_ENV_TYPE;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.TENANT_CONTEXT;
-import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
-
@RunWith(MockitoJUnitRunner.class)
public class AuditEcompOpEnvEventTest {
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.externalapi;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditActivateServiceExternalApiEventFactoryTest {
+
+ private AuditActivateServiceExternalApiEventFactory createTestSubject() {
+ Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditActivateServiceExternalApiEventFactory(commonAuData, "", "", "", "",
+ resAuData, resAuData, "", new User(), "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditActivateServiceExternalApiEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.externalapi;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditChangeLifecycleExternalApiEventFactoryTest {
+
+ private AuditChangeLifecycleExternalApiEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditChangeLifecycleExternalApiEventFactory(commonAuData, "", "", "", "",
+ resAuData, resAuData, "", new User(), "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditChangeLifecycleExternalApiEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.externalapi;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditCreateResourceExternalApiEventFactoryTest {
+
+ private AuditCreateResourceExternalApiEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditCreateResourceExternalApiEventFactory(commonAuData, "", "", "", "",
+ resAuData, resAuData, "", new User(), "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditCreateResourceExternalApiEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.externalapi;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditDownloadArtifactExternalApiEventFactoryTest {
+
+ private AuditDownloadArtifactExternalApiEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditDownloadArtifactExternalApiEventFactory(commonAuData, "", "", "", "",
+ resAuData, resAuData, "", new User(), "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditDownloadArtifactExternalApiEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.auditing.impl.externalapi;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
-import org.openecomp.sdc.be.auditing.impl.AuditingManager;
-import org.openecomp.sdc.be.config.Configuration;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
-import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
-import org.openecomp.sdc.be.dao.impl.AuditingDao;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
-import org.openecomp.sdc.be.resources.data.auditing.ExternalApiEvent;
-import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
-import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
-
-import java.util.EnumMap;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.modifier;
+import java.util.EnumMap;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
+import org.openecomp.sdc.be.auditing.impl.AuditingManager;
+import org.openecomp.sdc.be.config.Configuration;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
+import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
+import org.openecomp.sdc.be.dao.impl.AuditingDao;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.ExternalApiEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+
@RunWith(MockitoJUnitRunner.class)
public class AuditExternalApiEventFuncTest {
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.resourceadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditArtifactResourceAdminEventFactoryTest {
+
+ private AuditArtifactResourceAdminEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditArtifactResourceAdminEventFactory(AuditingActionEnum.ACTIVATE_SERVICE_BY_API, commonAuData,
+ resAuData, resAuData, "", "", "", new User(), "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditArtifactResourceAdminEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.resourceadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditCertificationResourceAdminEventFactoryTest {
+
+ private AuditCertificationResourceAdminEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditCertificationResourceAdminEventFactory(AuditingActionEnum.ACTIVATE_SERVICE_BY_API, commonAuData,
+ resAuData, resAuData, "", "", "", new User(), "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditCertificationResourceAdminEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.resourceadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditCreateUpdateResourceAdminEventFactoryTest {
+
+ private AuditCreateUpdateResourceAdminEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditCreateUpdateResourceAdminEventFactory(AuditingActionEnum.ACTIVATE_SERVICE_BY_API, commonAuData,
+ resAuData, resAuData, "", "", "", new User(), "", "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditCreateUpdateResourceAdminEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.resourceadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditDistStateChangeRequestResourceAdminEventFactoryTest {
+
+ private AuditDistStateChangeRequestResourceAdminEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditDistStateChangeRequestResourceAdminEventFactory(commonAuData, resAuData,
+ resAuData, "", "", "", new User(), "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditDistStateChangeRequestResourceAdminEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.resourceadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditDistStateChangeResourceAdminEventFactoryTest {
+
+ private AuditDistStateChangeResourceAdminEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ return new AuditDistStateChangeResourceAdminEventFactory(AuditingActionEnum.ACTIVATE_SERVICE_BY_API, commonAuData,
+ resAuData, resAuData, "", "", "", new User(), "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditDistStateChangeResourceAdminEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.resourceadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+
+public class AuditImportResourceAdminEventFactoryTest {
+
+ private AuditImportResourceAdminEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData.Builder newBuilder2 = ResourceAuditData.newBuilder();
+ ResourceAuditData resAuData = newBuilder2.build();
+ new AuditImportResourceAdminEventFactory(commonAuData, resAuData, resAuData, "", "", "", new User(), "");
+ return new AuditImportResourceAdminEventFactory(commonAuData, resAuData,
+ resAuData, "", "", "", new User(), "", "", "", "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditImportResourceAdminEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.auditing.impl.resourceadmin;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
-import org.openecomp.sdc.be.auditing.impl.AuditingManager;
-import org.openecomp.sdc.be.config.Configuration;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
-import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
-import org.openecomp.sdc.be.dao.impl.AuditingDao;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
-import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent;
-import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
-import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
-import org.openecomp.sdc.common.api.ConfigurationSource;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
-import org.openecomp.sdc.common.util.ThreadLocalsHolder;
-
-import java.util.EnumMap;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.modifier;
+import java.util.EnumMap;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
+import org.openecomp.sdc.be.auditing.impl.AuditingManager;
+import org.openecomp.sdc.be.config.Configuration;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
+import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
+import org.openecomp.sdc.be.dao.impl.AuditingDao;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+import org.openecomp.sdc.common.api.ConfigurationSource;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.openecomp.sdc.common.util.ThreadLocalsHolder;
+
@RunWith(MockitoJUnitRunner.class)
public class AuditResourceAdminEventFuncTest {
private AuditingManager auditingManager;
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.usersadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+
+public class AuditGetUsersListEventFactoryTest {
+
+ private AuditGetUsersListEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ return new AuditGetUsersListEventFactory(commonAuData, new User(), "");
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditGetUsersListEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditGetUsersListEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.usersadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+
+public class AuditUserAccessEventFactoryTest {
+
+ private AuditUserAccessEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ return new AuditUserAccessEventFactory(commonAuData, new User());
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditUserAccessEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditUserAccessEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.auditing.impl.usersadmin;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+
+public class AuditUserAdminEventFactoryTest {
+
+ private AuditUserAdminEventFactory createTestSubject() {
+ org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder newBuilder = CommonAuditData.newBuilder();
+ CommonAuditData commonAuData = newBuilder.build();
+ return new AuditUserAdminEventFactory(AuditingActionEnum.ACTIVATE_SERVICE_BY_API, commonAuData, new User(),
+ new User(), new User());
+ }
+
+ @Test
+ public void testGetLogMessage() throws Exception {
+ AuditUserAdminEventFactory testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLogMessage();
+ }
+
+ @Test
+ public void testGetDbEvent() throws Exception {
+ AuditUserAdminEventFactory testSubject;
+ AuditingGenericEvent result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDbEvent();
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.auditing.impl.usersadmin;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
-import org.openecomp.sdc.be.auditing.impl.AuditAuthRequestEventFactory;
-import org.openecomp.sdc.be.auditing.impl.AuditingManager;
-import org.openecomp.sdc.be.config.Configuration;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
-import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
-import org.openecomp.sdc.be.dao.impl.AuditingDao;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
-import org.openecomp.sdc.be.resources.data.auditing.AuthEvent;
-import org.openecomp.sdc.be.resources.data.auditing.GetUsersListEvent;
-import org.openecomp.sdc.be.resources.data.auditing.UserAccessEvent;
-import org.openecomp.sdc.be.resources.data.auditing.UserAdminEvent;
-import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
-
-import java.util.EnumMap;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyMap;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.modifier;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.user;
+import java.util.EnumMap;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
+import org.openecomp.sdc.be.auditing.impl.AuditAuthRequestEventFactory;
+import org.openecomp.sdc.be.auditing.impl.AuditingManager;
+import org.openecomp.sdc.be.config.Configuration;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
+import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
+import org.openecomp.sdc.be.dao.impl.AuditingDao;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
+import org.openecomp.sdc.be.resources.data.auditing.AuthEvent;
+import org.openecomp.sdc.be.resources.data.auditing.GetUsersListEvent;
+import org.openecomp.sdc.be.resources.data.auditing.UserAccessEvent;
+import org.openecomp.sdc.be.resources.data.auditing.UserAdminEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+
@RunWith(MockitoJUnitRunner.class)
public class AuditUserEventFuncTest {
@Mock
package org.openecomp.sdc.be.components;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.when;
+
+import java.util.EnumMap;
+import java.util.UUID;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
import org.openecomp.sdc.common.util.ThreadLocalsHolder;
-import java.util.EnumMap;
-import java.util.UUID;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.when;
-
@RunWith(MockitoJUnitRunner.class)
public class AuditingManagerTest extends BeConfDependentTest {
package org.openecomp.sdc.be.components;
-import com.google.common.collect.Sets;
-import fj.data.Either;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
import org.junit.Before;
import org.mockito.Mockito;
import org.openecomp.sdc.ElementOperationMock;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.google.common.collect.Sets;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class BaseServiceBusinessLogicTest {
private static final Logger log = LoggerFactory.getLogger(ServiceBusinessLogicTest.class);
private static final String SERVICE_CATEGORY = "Mobility";
package org.openecomp.sdc.be.components;
-import fj.data.Either;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.when;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class ComponentBusinessLogicTest {
package org.openecomp.sdc.be.components;
+import static org.mockito.Mockito.when;
+
+import javax.servlet.ServletContext;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
-import javax.servlet.ServletContext;
-
-import static org.mockito.Mockito.when;
/**
* tests GroupBusinessLogic class
* @author ns019t
package org.openecomp.sdc.be.components;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
import org.junit.Test;
import org.openecomp.sdc.be.components.health.HealthCheckBusinessLogic;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.api.HealthCheckInfo;
import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
public class HealthCheckBusinessLogicTest {
HealthCheckBusinessLogic healthCheckBusinessLogic = new HealthCheckBusinessLogic();
package org.openecomp.sdc.be.components;
+import java.util.HashMap;
+import java.util.Map;
+
import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.InterfaceDefinition;
import org.openecomp.sdc.be.model.Operation;
-import java.util.HashMap;
-import java.util.Map;
-
public interface InterfaceOperationTestUtils {
default InterfaceDefinition createInterface(String uniqueID, String description, String type,
package org.openecomp.sdc.be.components;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
import org.junit.Test;
import org.mockito.Mockito;
import org.openecomp.sdc.be.auditing.impl.AuditingManager;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class PathTest extends BaseServiceBusinessLogicTest {
public static final String fromNode = "fromNode";
package org.openecomp.sdc.be.components;
-import fj.data.Either;
-import junit.framework.Assert;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
+import junit.framework.Assert;
public class PropertyBusinessLogicTest {
package org.openecomp.sdc.be.components;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.junit.Before;
import org.junit.BeforeClass;
import org.openecomp.sdc.exception.PolicyException;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ResourceImportManagerTest {
package org.openecomp.sdc.be.components;
+import java.util.ArrayList;
+import java.util.List;
+
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import java.util.ArrayList;
-import java.util.List;
-
public class ResourceTestUtils {
public static Resource prepareResource(int resourceIndex) {
package org.openecomp.sdc.be.components;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.servlet.ServletContext;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.junit.Before;
import org.junit.Ignore;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ServiceBusinessLogicTest {
package org.openecomp.sdc.be.components;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.when;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.common.util.ThreadLocalsHolder;
import org.openecomp.sdc.exception.ResponseFormat;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
/**
* Created by chaya on 10/26/2017.
+++ /dev/null
-package org.openecomp.sdc.be.components.distribution.engine;
-
-import org.apache.http.HttpStatus;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.sdc.be.components.BeConfDependentTest;
-import org.openecomp.sdc.be.info.OperationalEnvInfo;
-import org.openecomp.sdc.common.http.client.api.HttpResponse;
-
-import static org.junit.Assert.assertTrue;
-
-public class AaiMockRequestHandlerTest extends BeConfDependentTest {
-
- @Ignore
- @Test
- public void testGetOperationalEnvJson() {
- String id = "OEid4";
- AaiRequestHandler aaiRequestHandler = new AaiRequestHandler();
- aaiRequestHandler.init();
- HttpResponse<String> resp = aaiRequestHandler.getOperationalEnvById(id);
-
- if (resp.getStatusCode() == HttpStatus.SC_OK) {
- try {
- String response = resp.getResponse();
- System.out.println("The rest response is:");
- System.out.println(response);
-
- OperationalEnvInfo operationalEnvInfo = OperationalEnvInfo.createFromJson(response);
-
- System.out.println(String.format("Get \"%s\" operational environment. %s", id, operationalEnvInfo));
- System.out.println(operationalEnvInfo);
- }
- catch (Exception e) {
- System.out.println(String.format("Json convert to OperationalEnvInfo failed with exception %s", e));
- System.out.println(HttpStatus.SC_INTERNAL_SERVER_ERROR);
- }
- }
- else {
- System.out.println("The rest response is:");
- String response = resp.getResponse();
- System.out.println(response);
- System.out.println(String.format("Get \"%s\" operational environment failed with statusCode: %s, response: %s, description: %s", id, resp.getStatusCode(), resp.getResponse(), resp.getDescription()));
- System.out.println(resp.getStatusCode());
- }
-
- assertTrue(true);
- }
-}
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.components.BeConfDependentTest;
+
+import mockit.Deencapsulation;
+
+public class AaiRequestHandlerTest extends BeConfDependentTest {
+
+ private AaiRequestHandler createTestSubject() {
+ AaiRequestHandler testSubject = new AaiRequestHandler();
+ testSubject.init();
+ return testSubject;
+ }
+
+ @Test
+ public void testInit() throws Exception {
+ AaiRequestHandler testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.init();
+ }
+
+ @Test
+ public void testGetOperationalEnvById() throws Exception {
+ AaiRequestHandler testSubject;
+ String id = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.getOperationalEnvById(id);
+ }
+
+ @Test
+ public void testRetryOnException() throws Exception {
+ AaiRequestHandler testSubject;
+ Exception e = null;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "retryOnException", new Object[] { Exception.class });
+ }
+
+ @Test
+ public void testGetCause() throws Exception {
+ AaiRequestHandler testSubject;
+ Exception e = null;
+ Throwable result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "getCause", new Object[] { Exception.class });
+ }
+
+ @Test
+ public void testCreateHeaders() throws Exception {
+ AaiRequestHandler testSubject;
+ Properties result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "createHeaders");
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.sdc.be.components.BeConfDependentTest;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.common.api.ArtifactTypeEnum;
+
+import mockit.Deencapsulation;
+
+public class ArtifactInfoImplTest extends BeConfDependentTest {
+
+ private ArtifactInfoImpl createTestSubject() {
+ return new ArtifactInfoImpl();
+ }
+
+ @Test
+ public void testConvertToArtifactInfoImpl() throws Exception {
+ Service service = new Service();
+ ComponentInstance resourceInstance = new ComponentInstance();
+ Collection<ArtifactDefinition> list = new LinkedList<>();
+ ArtifactDefinition artifactDefinition = new ArtifactDefinition();
+ List<ArtifactInfoImpl> result;
+
+ // test 1
+ result = ArtifactInfoImpl.convertToArtifactInfoImpl(service, resourceInstance, list);
+ Assert.assertEquals(new LinkedList<>(), result);
+
+ // test 2
+ artifactDefinition.setUniqueId("mock");
+ list.add(artifactDefinition);
+ result = ArtifactInfoImpl.convertToArtifactInfoImpl(service, resourceInstance, list);
+ Assert.assertFalse(result.isEmpty());
+
+ // test 3
+ artifactDefinition.setGeneratedFromId("mock");
+ result = ArtifactInfoImpl.convertToArtifactInfoImpl(service, resourceInstance, list);
+ Assert.assertFalse(result.isEmpty());
+ }
+
+ @Test
+ public void testConvertServiceArtifactToArtifactInfoImpl() throws Exception {
+ Service service = new Service();
+ Collection<ArtifactDefinition> list = new LinkedList<>();
+ ArtifactDefinition artifactDefinition = new ArtifactDefinition();
+ List<ArtifactInfoImpl> result = new LinkedList<>();
+
+ // test 1
+ result = ArtifactInfoImpl.convertServiceArtifactToArtifactInfoImpl(service, list);
+ Assert.assertEquals(new LinkedList<>(), result);
+
+ // test 2
+ artifactDefinition.setUniqueId("mock");
+ list.add(artifactDefinition);
+
+ result = ArtifactInfoImpl.convertServiceArtifactToArtifactInfoImpl(service, list);
+ Assert.assertFalse(result.isEmpty());
+
+ // test 3
+ artifactDefinition.setGeneratedFromId("mock");
+
+ result = ArtifactInfoImpl.convertServiceArtifactToArtifactInfoImpl(service, list);
+ Assert.assertFalse(result.isEmpty());
+ }
+
+ @Test
+ public void testGetUpdatedRequiredArtifactsFromNamesToUuids() throws Exception {
+ ArtifactDefinition artifactDefinition = null;
+ Map<String, ArtifactDefinition> artifacts = new HashMap<String, ArtifactDefinition>();
+ List<String> result;
+
+ // test 1
+ artifactDefinition = null;
+ result = Deencapsulation.invoke(ArtifactInfoImpl.class, "getUpdatedRequiredArtifactsFromNamesToUuids",
+ new Object[] { ArtifactDefinition.class, artifacts.getClass() });
+ Assert.assertEquals(null, result);
+
+ // test 2
+ artifactDefinition = new ArtifactDefinition();
+ result = Deencapsulation.invoke(ArtifactInfoImpl.class, "getUpdatedRequiredArtifactsFromNamesToUuids",
+ new Object[] { ArtifactDefinition.class, artifacts.getClass() });
+ Assert.assertEquals(null, result);
+ }
+
+ @Test
+ public void testGetArtifactName() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactName();
+ }
+
+ @Test
+ public void testSetArtifactName() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String artifactName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactName(artifactName);
+ }
+
+ @Test
+ public void testGetArtifactType() throws Exception {
+ ArtifactInfoImpl testSubject;
+ ArtifactTypeEnum result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactType();
+ }
+
+ @Test
+ public void testSetArtifactType() throws Exception {
+ ArtifactInfoImpl testSubject;
+ ArtifactTypeEnum artifactType = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactType(ArtifactTypeEnum.AAI_SERVICE_MODEL);
+ }
+
+ @Test
+ public void testGetArtifactURL() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactURL();
+ }
+
+ @Test
+ public void testSetArtifactURL() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String artifactURL = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactURL(artifactURL);
+ }
+
+ @Test
+ public void testGetArtifactChecksum() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactChecksum();
+ }
+
+ @Test
+ public void testSetArtifactChecksum() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String artifactChecksum = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactChecksum(artifactChecksum);
+ }
+
+ @Test
+ public void testGetArtifactDescription() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactDescription();
+ }
+
+ @Test
+ public void testSetArtifactDescription() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String artifactDescription = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactDescription(artifactDescription);
+ }
+
+ @Test
+ public void testGetArtifactTimeout() throws Exception {
+ ArtifactInfoImpl testSubject;
+ Integer result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactTimeout();
+ }
+
+ @Test
+ public void testSetArtifactTimeout() throws Exception {
+ ArtifactInfoImpl testSubject;
+ Integer artifactTimeout = 0;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactTimeout(artifactTimeout);
+ }
+
+ @Test
+ public void testGetRelatedArtifacts() throws Exception {
+ ArtifactInfoImpl testSubject;
+ List<String> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getRelatedArtifacts();
+ }
+
+ @Test
+ public void testSetRelatedArtifacts() throws Exception {
+ ArtifactInfoImpl testSubject;
+ List<String> relatedArtifacts = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setRelatedArtifacts(relatedArtifacts);
+ }
+
+ @Test
+ public void testToString() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.toString();
+ }
+
+ @Test
+ public void testGetArtifactUUID() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactUUID();
+ }
+
+ @Test
+ public void testSetArtifactUUID() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String artifactUUID = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactUUID(artifactUUID);
+ }
+
+ @Test
+ public void testGetArtifactVersion() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactVersion();
+ }
+
+ @Test
+ public void testSetArtifactVersion() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String artifactVersion = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactVersion(artifactVersion);
+ }
+
+ @Test
+ public void testGetGeneratedFromUUID() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getGeneratedFromUUID();
+ }
+
+ @Test
+ public void testSetGeneratedFromUUID() throws Exception {
+ ArtifactInfoImpl testSubject;
+ String generatedFromUUID = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setGeneratedFromUUID(generatedFromUUID);
+ }
+
+ @Test
+ public void testUpdateArtifactTimeout() throws Exception {
+ ArtifactInfoImpl testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.updateArtifactTimeout();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
+
+public class CambriaErrorResponseTest {
+
+ private CambriaErrorResponse createTestSubject() {
+ return new CambriaErrorResponse();
+ }
+
+ @Test
+ public void testConstructors() throws Exception {
+ CambriaErrorResponse testSubject;
+ CambriaOperationStatus result;
+
+ // default test
+ new CambriaErrorResponse(CambriaOperationStatus.AUTHENTICATION_ERROR);
+ new CambriaErrorResponse(CambriaOperationStatus.CONNNECTION_ERROR, 500);
+ }
+
+ @Test
+ public void testGetOperationStatus() throws Exception {
+ CambriaErrorResponse testSubject;
+ CambriaOperationStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getOperationStatus();
+ }
+
+ @Test
+ public void testSetOperationStatus() throws Exception {
+ CambriaErrorResponse testSubject;
+ CambriaOperationStatus operationStatus = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setOperationStatus(operationStatus);
+ }
+
+ @Test
+ public void testGetHttpCode() throws Exception {
+ CambriaErrorResponse testSubject;
+ Integer result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getHttpCode();
+ }
+
+ @Test
+ public void testSetHttpCode() throws Exception {
+ CambriaErrorResponse testSubject;
+ Integer httpCode = 0;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setHttpCode(httpCode);
+ }
+
+ @Test
+ public void testAddVariable() throws Exception {
+ CambriaErrorResponse testSubject;
+ String variable = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.addVariable(variable);
+ }
+
+ @Test
+ public void testGetVariables() throws Exception {
+ CambriaErrorResponse testSubject;
+ List<String> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVariables();
+ }
+
+ @Test
+ public void testSetVariables() throws Exception {
+ CambriaErrorResponse testSubject;
+ List<String> variables = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setVariables(variables);
+ }
+
+ @Test
+ public void testToString() throws Exception {
+ CambriaErrorResponse testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.toString();
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.components.distribution.engine;
-import com.att.nsa.apiClient.credentials.ApiCredential;
-import com.att.nsa.apiClient.http.HttpException;
-import com.att.nsa.cambria.client.CambriaClient.CambriaApiException;
-import com.att.nsa.cambria.client.CambriaIdentityManager;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doReturn;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.security.GeneralSecurityException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.components.BeConfDependentTest;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
import org.openecomp.sdc.common.api.ConfigurationSource;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.security.GeneralSecurityException;
-import java.util.Arrays;
+import com.att.nsa.apiClient.credentials.ApiCredential;
+import com.att.nsa.apiClient.http.HttpException;
+import com.att.nsa.cambria.client.CambriaClient;
+import com.att.nsa.cambria.client.CambriaClient.CambriaApiException;
+import com.att.nsa.cambria.client.CambriaClientBuilders.AbstractAuthenticatedManagerBuilder;
+import com.att.nsa.cambria.client.CambriaClientBuilders.TopicManagerBuilder;
+import com.att.nsa.cambria.client.CambriaConsumer;
+import com.att.nsa.cambria.client.CambriaIdentityManager;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doReturn;
+import fj.data.Either;
+import mockit.Deencapsulation;
@RunWith(MockitoJUnitRunner.class)
-public class CambriaHandlerTest {
- @Spy
- private CambriaHandler handler = new CambriaHandler();
+public class CambriaHandlerTest extends BeConfDependentTest {
+
+ private CambriaHandler createTestSubject() {
+ return new CambriaHandler();
+ }
+
+ @Spy
+ private CambriaHandler handler = new CambriaHandler();
+
+ @Mock
+ private CambriaIdentityManager createIdentityManager;
+
+ private ApiCredential apiCredential = new ApiCredential("apiKey", "apiSecret");
+
+ @BeforeClass
+ public static void beforeClass() {
+ String appConfigDir = "src/test/resources/config/catalog-be";
+ ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(),
+ appConfigDir);
+ new ConfigurationManager(configurationSource);
+ }
+
+ @Before
+ public void startUp() throws MalformedURLException, GeneralSecurityException {
+ doReturn(createIdentityManager).when(handler).buildCambriaClient(any());
+ }
+
+ @Test
+ public void testMockCreateUebKeys() throws HttpException, CambriaApiException, IOException {
+ Mockito.when(createIdentityManager.createApiKey(Mockito.anyString(), Mockito.anyString()))
+ .thenReturn(apiCredential);
+ Either<ApiCredential, CambriaErrorResponse> eitherCreateUebKeys = handler
+ .createUebKeys(Arrays.asList("Myhost:1234"));
+
+ Mockito.verify(createIdentityManager).setApiCredentials(Mockito.anyString(), Mockito.anyString());
+
+ assertTrue("Unexpected Operational Status", eitherCreateUebKeys.isLeft());
+
+ }
+
+ @Test
+ public void testMockCreateUebKeys_FAIL() throws HttpException, CambriaApiException, IOException {
+ Mockito.when(createIdentityManager.createApiKey(Mockito.anyString(), Mockito.anyString()))
+ .thenThrow(new CambriaApiException("Error Message"));
+ Either<ApiCredential, CambriaErrorResponse> eitherCreateUebKeys = handler
+ .createUebKeys(Arrays.asList("Myhost:1234"));
+ Mockito.verify(createIdentityManager, Mockito.never()).setApiCredentials(Mockito.anyString(),
+ Mockito.anyString());
+ assertTrue("Unexpected Operational Status", eitherCreateUebKeys.isRight());
+ CambriaErrorResponse response = eitherCreateUebKeys.right().value();
+ assertEquals("Unexpected Operational Status", CambriaOperationStatus.CONNNECTION_ERROR,
+ response.getOperationStatus());
+ assertEquals("Unexpected HTTP Code", 500, response.getHttpCode().intValue());
+ }
+
+ @Test
+ public void testProcessMessageException() throws Exception {
+ CambriaHandler testSubject;
+ String message = "";
+ Integer result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "processMessageException", new Object[] { message });
+ }
+
+ @Test
+ public void testCheckPattern() throws Exception {
+ CambriaHandler testSubject;
+ String patternStr = "";
+ String message = "";
+ int groupIndex = 0;
+ Integer result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "checkPattern", new Object[] { patternStr, message, groupIndex });
+ }
+
+ @Test
+ public void testGetTopics() throws Exception {
+ CambriaHandler testSubject;
+ List<String> hostSet = new LinkedList<>();
+ hostSet.add("mock");
+ Either<Set<String>, CambriaErrorResponse> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getTopics(hostSet);
+ }
+
+ @Test
+ public void testProcessError() throws Exception {
+ CambriaHandler testSubject;
+ Exception e = null;
+ CambriaErrorResponse result;
+
+ // default test
+ testSubject = createTestSubject();
+
+ e = new Exception("HTTP Status 999");
+ result = Deencapsulation.invoke(testSubject, "processError", e);
+
+ e = new Exception("HTTP Status 401");
+ result = Deencapsulation.invoke(testSubject, "processError", e);
+
+ e = new Exception("HTTP Status 409");
+ result = Deencapsulation.invoke(testSubject, "processError", e);
+
+ e = new Exception("HTTP Status 500");
+ result = Deencapsulation.invoke(testSubject, "processError", e);
+
+ e = new Exception("mock", new Throwable(new Throwable("mock")));
+ result = Deencapsulation.invoke(testSubject, "processError", e);
+ }
+
+ @Test
+ public void testWriteErrorToLog() throws Exception {
+ CambriaHandler testSubject;
+ CambriaErrorResponse cambriaErrorResponse = new CambriaErrorResponse();
+ cambriaErrorResponse.setOperationStatus(CambriaOperationStatus.AUTHENTICATION_ERROR);
+ String errorMessage = "mock";
+ String methodName = "mock";
+ String operationDesc = "mock";
+
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "writeErrorToLog", cambriaErrorResponse, "mock", "mock", "mock");
+ }
+
+ @Test
+ public void testCreateTopic() throws Exception {
+ CambriaHandler testSubject;
+ Collection<String> hostSet = new LinkedList<>();
+ hostSet.add("mock");
+ String apiKey = "mock";
+ String secretKey = "mock";
+ String topicName = "mock";
+ int partitionCount = 0;
+ int replicationCount = 0;
+ CambriaErrorResponse result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.createTopic(hostSet, apiKey, secretKey, topicName, partitionCount, replicationCount);
+ }
+
+ @Test
+ public void testUnRegisterFromTopic() throws Exception {
+ CambriaHandler testSubject;
+ Collection<String> hostSet = new LinkedList<>();
+ hostSet.add("mock");
+ String managerApiKey = "mock";
+ String managerSecretKey = "mock";
+ String subscriberApiKey = "mock";
+ String topicName = "mock";
+ CambriaErrorResponse unRegisterFromTopic = null;
+
+ // default test
+ testSubject = createTestSubject();
+ unRegisterFromTopic = testSubject.unRegisterFromTopic(hostSet, managerApiKey, managerSecretKey,
+ subscriberApiKey, SubscriberTypeEnum.CONSUMER, topicName);
+ }
+
+ @Test
+ public void testRegisterToTopic() throws Exception {
+ CambriaHandler testSubject;
+ Collection<String> hostSet = new LinkedList<String>();
+ hostSet.add("mock");
+ String managerApiKey = "mock";
+ String managerSecretKey = "mock";
+ String subscriberApiKey = "mock";
+ SubscriberTypeEnum subscriberTypeEnum = null;
+ String topicName = "mock";
+ CambriaErrorResponse result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.registerToTopic(hostSet, managerApiKey, managerSecretKey, subscriberApiKey,
+ SubscriberTypeEnum.CONSUMER, topicName);
+ }
+
+ @Test
+ public void testCreateConsumer() throws Exception {
+ CambriaHandler testSubject;
+ Collection<String> hostSet = new LinkedList<>();
+ hostSet.add("mock");
+ String topicName = "mock";
+ String apiKey = "mock";
+ String secretKey = "mock";
+ String consumerId = "mock";
+ String consumerGroup = "mock";
+ int timeoutMS = 0;
+ CambriaConsumer result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.createConsumer(hostSet, topicName, apiKey, secretKey, consumerId, consumerGroup,
+ timeoutMS);
+ }
+
+ @Test
+ public void testCloseConsumer() throws Exception {
+ CambriaHandler testSubject;
+ CambriaConsumer consumer = null;
+
+ // test 1
+ testSubject = createTestSubject();
+ consumer = null;
+ testSubject.closeConsumer(consumer);
+ }
+
+ @Test
+ public void testFetchFromTopic() throws Exception {
+ CambriaHandler testSubject;
+ CambriaConsumer topicConsumer = null;
+ Either<Iterable<String>, CambriaErrorResponse> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.fetchFromTopic(topicConsumer);
+ }
- @Mock
- private CambriaIdentityManager createIdentityManager;
+ @Test
+ public void testSendNotification() throws Exception {
+ CambriaHandler testSubject;
+ String topicName = "mock";
+ String uebPublicKey = "mock";
+ String uebSecretKey = "mock";
+ List<String> uebServers = new LinkedList<>();
+ uebServers.add("mock");
+ INotificationData data = null;
+ CambriaErrorResponse result;
- private ApiCredential apiCredential = new ApiCredential("apiKey", "apiSecret");
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.sendNotification(topicName, uebPublicKey, uebSecretKey, uebServers, data);
+ }
- @BeforeClass
- public static void beforeClass() {
- String appConfigDir = "src/test/resources/config/catalog-be";
- ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir);
- new ConfigurationManager(configurationSource);
- }
+ @Test
+ public void testSendNotificationAndClose() throws Exception {
+ CambriaHandler testSubject;
+ String topicName = "mock";
+ String uebPublicKey = "mock";
+ String uebSecretKey = "mock";
+ List<String> uebServers = new LinkedList<>();
+ uebServers.add("mock");
+ INotificationData data = null;
+ long waitBeforeCloseTimeout = 1;
+ CambriaErrorResponse result;
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.sendNotificationAndClose(topicName, uebPublicKey, uebSecretKey, uebServers, data,
+ waitBeforeCloseTimeout);
+ }
- @Before
- public void startUp() throws MalformedURLException, GeneralSecurityException {
- doReturn(createIdentityManager).when(handler).buildCambriaClient(any());
- }
+ @Test
+ public void testGetApiKey() throws Exception {
+ CambriaHandler testSubject;
+ String server = "";
+ String apiKey = "";
+ CambriaErrorResponse result;
- @Test
- public void testCreateUebKeys() throws HttpException, CambriaApiException, IOException {
- Mockito.when(createIdentityManager.createApiKey(Mockito.anyString(), Mockito.anyString())).thenReturn(apiCredential);
- Either<ApiCredential, CambriaErrorResponse> eitherCreateUebKeys = handler.createUebKeys(Arrays.asList("Myhost:1234") );
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getApiKey(server, apiKey);
+ }
- Mockito.verify(createIdentityManager).setApiCredentials(Mockito.anyString(), Mockito.anyString());
+ @Test
+ public void testCreateUebKeys() throws Exception {
+ CambriaHandler testSubject;
+ List<String> hostSet = null;
+ Either<ApiCredential, CambriaErrorResponse> result;
- assertTrue("Unexpected Operational Status", eitherCreateUebKeys.isLeft());
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.createUebKeys(hostSet);
+ }
- }
+ @Test
+ public void testBuildCambriaClient() throws Exception {
+ CambriaHandler testSubject;
+ AbstractAuthenticatedManagerBuilder<? extends CambriaClient> client = new TopicManagerBuilder()
+ .usingHosts("mock").authenticatedBy("mock", "mock");
- @Test
- public void testCreateUebKeys_FAIL() throws HttpException, CambriaApiException, IOException {
- Mockito.when(createIdentityManager.createApiKey(Mockito.anyString(), Mockito.anyString())).thenThrow(new CambriaApiException("Error Message"));
- Either<ApiCredential, CambriaErrorResponse> eitherCreateUebKeys = handler.createUebKeys(Arrays.asList("Myhost:1234") );
- Mockito.verify(createIdentityManager, Mockito.never()).setApiCredentials(Mockito.anyString(), Mockito.anyString());
- assertTrue("Unexpected Operational Status", eitherCreateUebKeys.isRight());
- CambriaErrorResponse response = eitherCreateUebKeys.right().value();
- assertEquals("Unexpected Operational Status", CambriaOperationStatus.CONNNECTION_ERROR, response.getOperationStatus());
- assertEquals("Unexpected HTTP Code", 500, response.getHttpCode().intValue());
- }
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "buildCambriaClient", client);
+ }
-}
+}
\ No newline at end of file
package org.openecomp.sdc.be.components.distribution.engine;
-import com.att.nsa.mr.client.MRConsumer;
-import com.google.gson.GsonBuilder;
+import java.util.concurrent.ExecutorService;
+import java.util.stream.IntStream;
+
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import java.util.concurrent.ExecutorService;
-import java.util.stream.IntStream;
+import com.att.nsa.mr.client.MRConsumer;
+import com.google.gson.GsonBuilder;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:application-context-test.xml")
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.components.BeConfDependentTest;
+import org.openecomp.sdc.be.components.distribution.engine.DistributionEngineClusterHealth.HealthCheckScheduledTask;
+import org.openecomp.sdc.common.api.HealthCheckInfo;
+
+import mockit.Deencapsulation;
+
+public class DistributionEngineClusterHealthTest extends BeConfDependentTest{
+
+ private DistributionEngineClusterHealth createTestSubject() {
+ return new DistributionEngineClusterHealth();
+ }
+
+ @Test
+ public void testInit() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "init");
+ }
+
+ @Test
+ public void testDestroy() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "destroy");
+ }
+
+ @Test
+ public void testStartHealthCheckTask() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+ Map<String, AtomicBoolean> envNamePerStatus = null;
+ boolean startTask = false;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.startHealthCheckTask(envNamePerStatus, startTask);
+ }
+
+ @Test
+ public void testStartHealthCheckTask_1() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+ Map<String, AtomicBoolean> envNamePerStatus = new HashMap<>();
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.init();
+ testSubject.startHealthCheckTask(envNamePerStatus);
+ }
+
+ @Test
+ public void testHealthCheckScheduledTask() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+ Map<String, AtomicBoolean> envNamePerStatus = new HashMap<>();
+
+ // default test
+ testSubject = createTestSubject();
+ HealthCheckScheduledTask healthCheckScheduledTask = testSubject. new HealthCheckScheduledTask(new LinkedList<>());
+ LinkedList<UebHealthCheckCall> healthCheckCalls = new LinkedList<>();
+ UebHealthCheckCall hcc = new UebHealthCheckCall("mock", "mock");
+ healthCheckCalls.add(hcc);
+ healthCheckScheduledTask.healthCheckCalls = healthCheckCalls;
+
+ Deencapsulation.invoke(healthCheckScheduledTask, "queryUeb");
+ }
+
+ @Test
+ public void testHealthCheckScheduledTaskRun() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+ Map<String, AtomicBoolean> envNamePerStatus = new HashMap<>();
+ envNamePerStatus.put("mock", new AtomicBoolean(true));
+ // default test
+ testSubject = createTestSubject();
+ testSubject.startHealthCheckTask(envNamePerStatus, false);
+ HealthCheckScheduledTask healthCheckScheduledTask = testSubject. new HealthCheckScheduledTask(new LinkedList<>());
+ LinkedList<UebHealthCheckCall> healthCheckCalls = new LinkedList<>();
+ UebHealthCheckCall hcc = new UebHealthCheckCall("mock", "mock");
+ healthCheckCalls.add(hcc);
+ healthCheckScheduledTask.healthCheckCalls = healthCheckCalls;
+
+ Deencapsulation.invoke(healthCheckScheduledTask, "run");
+ }
+
+ @Test
+ public void testHealthCheckScheduledTaskRun_2() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+ Map<String, AtomicBoolean> envNamePerStatus = new HashMap<>();
+ envNamePerStatus.put("mock", new AtomicBoolean(false));
+ // default test
+ testSubject = createTestSubject();
+ testSubject.startHealthCheckTask(envNamePerStatus, false);
+ HealthCheckScheduledTask healthCheckScheduledTask = testSubject. new HealthCheckScheduledTask(new LinkedList<>());
+ LinkedList<UebHealthCheckCall> healthCheckCalls = new LinkedList<>();
+ UebHealthCheckCall hcc = new UebHealthCheckCall("mock", "mock");
+ healthCheckCalls.add(hcc);
+ healthCheckScheduledTask.healthCheckCalls = healthCheckCalls;
+
+ Deencapsulation.invoke(healthCheckScheduledTask, "run");
+ }
+
+ @Test
+ public void testLogAlarm() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+ boolean lastHealthState = false;
+
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "logAlarm", new Object[] { lastHealthState });
+ }
+
+ @Test
+ public void testGetHealthCheckInfo() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+ HealthCheckInfo result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getHealthCheckInfo();
+ }
+
+ @Test
+ public void testSetHealthCheckUebIsDisabled() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setHealthCheckUebIsDisabled();
+ }
+
+ @Test
+ public void testSetHealthCheckUebConfigurationError() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setHealthCheckUebConfigurationError();
+ }
+
+ @Test
+ public void testSetHealthCheckOkAndReportInCaseLastStateIsDown() throws Exception {
+ DistributionEngineClusterHealth testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setHealthCheckOkAndReportInCaseLastStateIsDown();
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.components.distribution.engine;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
public class DistributionEngineConfigTest {
@Before
package org.openecomp.sdc.be.components.distribution.engine;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus;
-import java.util.List;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
public class DistributionEngineHealthCheckTest extends BeConfDependentTest {
package org.openecomp.sdc.be.components.distribution.engine;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
import org.apache.commons.collections.CollectionUtils;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class DistributionEngineInitTaskTest {
assertEquals("check next retry interval reach max retry interval", initTask.getCurrentRetryInterval(), maxRetry);
}
+
+ @Test
+ public void checkStartTask() {
+
+ String envName = "PrOD";
+ DistributionEngineConfiguration deConfiguration = new DistributionEngineConfiguration();
+ int retry = 2;
+ int maxRetry = 40;
+ deConfiguration.setInitRetryIntervalSec(retry);
+ deConfiguration.setInitMaxIntervalSec(maxRetry);
+ DistributionEngineInitTask initTask = new DistributionEngineInitTask(0l, deConfiguration, envName, new AtomicBoolean(false), componentsUtils, null, readEnvFromConfig(deConfiguration));
+
+ initTask.startTask();
+ }
+
+ @Test
+ public void checkRestartTask() {
+
+ String envName = "PrOD";
+
+ DistributionEngineConfiguration deConfiguration = new DistributionEngineConfiguration();
+ int retry = 2;
+ int maxRetry = 40;
+ deConfiguration.setInitRetryIntervalSec(retry);
+ deConfiguration.setInitMaxIntervalSec(maxRetry);
+ DistributionEngineInitTask initTask = new DistributionEngineInitTask(0l, deConfiguration, envName, new AtomicBoolean(false), componentsUtils, null, readEnvFromConfig(deConfiguration));
+
+ initTask.restartTask();
+ }
+
+ @Test
+ public void checkStopTask() {
+
+ String envName = "PrOD";
+
+ DistributionEngineConfiguration deConfiguration = new DistributionEngineConfiguration();
+ int retry = 2;
+ int maxRetry = 40;
+ deConfiguration.setInitRetryIntervalSec(retry);
+ deConfiguration.setInitMaxIntervalSec(maxRetry);
+ DistributionEngineInitTask initTask = new DistributionEngineInitTask(0l, deConfiguration, envName, new AtomicBoolean(false), componentsUtils, null, readEnvFromConfig(deConfiguration));
+
+ initTask.stopTask();
+ initTask.startTask();
+ initTask.stopTask();
+ }
+
+ @Test
+ public void checkDestroy() {
+
+ String envName = "PrOD";
+
+ DistributionEngineConfiguration deConfiguration = new DistributionEngineConfiguration();
+ int retry = 2;
+ int maxRetry = 40;
+ deConfiguration.setInitRetryIntervalSec(retry);
+ deConfiguration.setInitMaxIntervalSec(maxRetry);
+ DistributionEngineInitTask initTask = new DistributionEngineInitTask(0l, deConfiguration, envName, new AtomicBoolean(false), componentsUtils, null, readEnvFromConfig(deConfiguration));
+
+ initTask.destroy();
+ }
+
+ @Test
+ public void checkRun() {
+
+ String notifTopic = "notif";
+ String statusTopic = "status";
+
+ List<String> uebServers = new ArrayList<>();
+ uebServers.add("server1");
+ CambriaErrorResponse cambriaErrorResponse = new CambriaErrorResponse(CambriaOperationStatus.NOT_FOUND);
+ Either<Set<String>, CambriaErrorResponse> right = Either.right(cambriaErrorResponse);
+ when(cambriaHandler.getTopics(Mockito.any(List.class))).thenReturn(right);
+
+ String envName = "PrOD";
+
+ DistributionEngineConfiguration deConfiguration = new DistributionEngineConfiguration();
+ deConfiguration.setUebServers(uebServers);
+ int retry = 2;
+ int maxRetry = 40;
+ deConfiguration.setInitRetryIntervalSec(retry);
+ deConfiguration.setInitMaxIntervalSec(maxRetry);
+ deConfiguration.setDistributionNotifTopicName(notifTopic);
+ deConfiguration.setDistributionStatusTopicName(statusTopic);
+ CreateTopicConfig createTopic = new CreateTopicConfig();
+ createTopic.setPartitionCount(1);
+ createTopic.setReplicationCount(1);
+ deConfiguration.setCreateTopic(createTopic);
+
+ cambriaErrorResponse = new CambriaErrorResponse(CambriaOperationStatus.OK);
+
+ String realNotifTopic = notifTopic + "-" + envName.toUpperCase();
+ String realStatusTopic = statusTopic + "-" + envName.toUpperCase();
+ when(cambriaHandler.createTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.eq(realNotifTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse);
+ when(cambriaHandler.createTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.eq(realStatusTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse);
+
+ cambriaErrorResponse = new CambriaErrorResponse(CambriaOperationStatus.OK);
+ when(cambriaHandler.registerToTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()))
+ .thenReturn(cambriaErrorResponse);
+
+ DistributionEngineInitTask initTask = new DistributionEngineInitTask(0l, deConfiguration, envName, new AtomicBoolean(false), componentsUtils, null, readEnvFromConfig(deConfiguration));
+ initTask.setCambriaHandler(cambriaHandler);
+
+ boolean initFlow = initTask.initFlow();
+
+ initTask.run();
+ }
+
@SuppressWarnings("unchecked")
@Test
public void testInitFlowScenarioSuccess() {
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.openecomp.sdc.be.components.BeConfDependentTest;
+import org.openecomp.sdc.be.components.distribution.engine.report.DistributionCompleteReporter;
+import org.openecomp.sdc.be.config.DistributionEngineConfiguration;
+import org.openecomp.sdc.be.impl.ComponentsUtils;
+import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+
+import mockit.Deencapsulation;
+
+public class DistributionEnginePollingTaskTest extends BeConfDependentTest {
+
+ @Mock
+ private ComponentsUtils componentsUtils;
+
+ private DistributionEnginePollingTask createTestSubject() {
+ componentsUtils = Mockito.mock(ComponentsUtils.class);
+ DistributionEngineConfiguration distributionEngineConfiguration = configurationManager
+ .getDistributionEngineConfiguration();
+
+ return new DistributionEnginePollingTask(distributionEngineConfiguration,
+ new DistributionCompleteReporterMock(), componentsUtils, new DistributionEngineClusterHealth(),
+ new OperationalEnvironmentEntry());
+ }
+
+ @Test
+ public void testStartTask() throws Exception {
+ DistributionEnginePollingTask testSubject;
+ String topicName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.startTask(topicName);
+ }
+
+ @Test
+ public void testStopTask() throws Exception {
+ DistributionEnginePollingTask testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.stopTask();
+ }
+
+ @Test
+ public void testDestroy() throws Exception {
+ DistributionEnginePollingTask testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.destroy();
+ }
+
+ @Test
+ public void testRun() throws Exception {
+ DistributionEnginePollingTask testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.run();
+ }
+
+ @Test
+ public void testHandleDistributionNotificationMsg() throws Exception {
+ DistributionEnginePollingTask testSubject;
+ DistributionStatusNotification notification = new DistributionStatusNotification();
+ notification.setDistributionID("mock");
+ notification.setConsumerID("mock");
+ notification.setArtifactURL("mock");
+ notification.setTimestamp(435435);
+ notification.setStatus(DistributionStatusNotificationEnum.ALREADY_DEPLOYED);
+ notification.setErrorReason("mock");
+
+
+
+ // default test
+ testSubject = createTestSubject();
+ Mockito.doNothing().when(componentsUtils).auditDistributionStatusNotification(Mockito.any(AuditingActionEnum.class),
+ Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(),
+ Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
+ Deencapsulation.invoke(testSubject, "handleDistributionNotificationMsg",
+ notification);
+ }
+
+ @Test
+ public void testShutdownExecutor() throws Exception {
+ DistributionEnginePollingTask testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "shutdownExecutor");
+ }
+
+ private class DistributionCompleteReporterMock implements DistributionCompleteReporter {
+
+ @Override
+ public void reportDistributionComplete(DistributionStatusNotification distributionStatusNotification) {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+}
\ No newline at end of file
package org.openecomp.sdc.be.components.distribution.engine;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.openecomp.sdc.be.components.utils.OperationalEnvironmentBuilder;
+import org.openecomp.sdc.be.config.DistributionEngineConfiguration;
+import org.openecomp.sdc.be.config.DistributionEngineConfiguration.DistributionStatusTopicConfig;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
+import mockit.Deencapsulation;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+public class DistributionEngineTest{
+
+ public static final String DISTRIBUTION_ID = "distId";
+ public static final String ENV_ID = "envId";
+ public static final String USER_ID = "userId";
+ public static final String MODIFIER = "modifier";
+
+ @InjectMocks
+ private DistributionEngine testInstance;
+
+ @Mock
+ private EnvironmentsEngine environmentsEngine;
+
+ @Mock
+ private DistributionNotificationSender distributionNotificationSender;
+
+ @Mock
+ private ServiceDistributionArtifactsBuilder serviceDistributionArtifactsBuilder;
+
+ private DummyDistributionConfigurationManager distributionEngineConfigurationMock;
+
+ private Map<String, OperationalEnvironmentEntry> envs;
+
+ @Before
+ public void setUpMock() throws Exception {
+ MockitoAnnotations.initMocks(this);
+ distributionEngineConfigurationMock = new DummyDistributionConfigurationManager();
+ envs = getEnvs(ENV_ID);
+ }
+
+ @Test
+ public void notifyService() throws Exception {
+ NotificationDataImpl notificationData = new NotificationDataImpl();
+ Service service = new Service();
+ when(environmentsEngine.getEnvironmentById(ENV_ID)).thenReturn(envs.get(ENV_ID));
+ when(distributionEngineConfigurationMock.getConfigurationMock().getDistributionNotifTopicName())
+ .thenReturn("topic");
+ when(distributionNotificationSender.sendNotification(eq("topic-ENVID"), eq(DISTRIBUTION_ID),
+ any(EnvironmentMessageBusData.class), any(NotificationDataImpl.class), any(Service.class), eq(USER_ID),
+ eq(MODIFIER))).thenReturn(ActionStatus.OK);
+ ActionStatus actionStatus = testInstance.notifyService(DISTRIBUTION_ID, service, notificationData, ENV_ID,
+ USER_ID, MODIFIER);
+ assertEquals(ActionStatus.OK, actionStatus);
+ }
+
+ @Test
+ public void notifyService_couldNotResolveEnvironment() throws Exception {
+ when(environmentsEngine.getEnvironments()).thenReturn(envs);
+ ActionStatus actionStatus = testInstance.notifyService(DISTRIBUTION_ID, new Service(),
+ new NotificationDataImpl(), "someNonExisitngEnv", USER_ID, MODIFIER);
+ assertEquals(ActionStatus.DISTRIBUTION_ENVIRONMENT_NOT_AVAILABLE, actionStatus);
+ verifyZeroInteractions(distributionNotificationSender);
+ }
+
+ @Test
+ public void notifyService_failedWhileSendingNotification() throws Exception {
+ NotificationDataImpl notificationData = new NotificationDataImpl();
+ Service service = new Service();
+ when(environmentsEngine.getEnvironmentById(ENV_ID)).thenReturn(envs.get(ENV_ID));
+ when(distributionEngineConfigurationMock.getConfigurationMock().getDistributionNotifTopicName())
+ .thenReturn("topic");
+ when(distributionNotificationSender.sendNotification(eq("topic-ENVID"), eq(DISTRIBUTION_ID),
+ any(EnvironmentMessageBusData.class), any(NotificationDataImpl.class), any(Service.class), eq(USER_ID),
+ eq(MODIFIER))).thenReturn(ActionStatus.GENERAL_ERROR);
+ ActionStatus actionStatus = testInstance.notifyService(DISTRIBUTION_ID, service, notificationData, ENV_ID,
+ USER_ID, MODIFIER);
+ assertEquals(ActionStatus.GENERAL_ERROR, actionStatus);
+ }
+
+ private Map<String, OperationalEnvironmentEntry> getEnvs(String... environmentIds) {
+ Set<String> uebAddress = new HashSet<>();
+ uebAddress.add("someAddress");
+ return Stream.of(environmentIds)
+ .map(id -> new OperationalEnvironmentBuilder().setEnvId(id).setDmaapUebAddress(uebAddress).build())
+ .collect(Collectors.toMap(OperationalEnvironmentEntry::getEnvironmentId, Function.identity()));
+ }
+
+ private DistributionEngine createTestSubject() {
+ return new DistributionEngine();
+ }
+
+ /*@Test(expected=ExceptionInInitializerError.class)
+ public void testMain() throws Exception {
+ String[] args = new String[] { "" };
+
+ // default test
+ DistributionEngine.main(args);
+ }*/
+
+ @Test
+ public void testIsActive() throws Exception {
+ DistributionEngine testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isActive();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testInit() throws Exception {
+ DistributionEngine testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "init");
+ }
+
+ @Test
+ public void testShutdown() throws Exception {
+ DistributionEngine testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.shutdown();
+ }
+
+ @Test
+ public void testValidateConfiguration() throws Exception {
+ DistributionEngine testSubject;
+ DistributionEngineConfiguration deConfiguration = new DistributionEngineConfiguration();
+ deConfiguration.setDistributionStatusTopic((new DistributionStatusTopicConfig()));
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "validateConfiguration", deConfiguration);
+ }
+
+ @Test
+ public void testIsValidServers() throws Exception {
+ DistributionEngine testSubject;
+ List<String> uebServers = null;
+ String methodName = "";
+ String paramName = "";
+ boolean result;
+
+ // test 1
+ testSubject = createTestSubject();
+ uebServers = null;
+ result = Deencapsulation.invoke(testSubject, "isValidServers",
+ new Object[] { List.class, methodName, paramName });
+ Assert.assertEquals(false, result);
+ }
+
+ @Test
+ public void testIsValidFqdn() throws Exception {
+ DistributionEngine testSubject;
+ String serverFqdn = "";
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "isValidFqdn", new Object[] { serverFqdn });
+ }
+
+ @Test
+ public void testIsValidParam() throws Exception {
+ DistributionEngine testSubject;
+ String paramValue = "";
+ String methodName = "";
+ String paramName = "";
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "isValidParam",
+ new Object[] { paramValue, methodName, paramName });
+ }
+
+ @Test
+ public void testIsValidParam_1() throws Exception {
+ DistributionEngine testSubject;
+ List<String> paramValue = null;
+ String methodName = "";
+ String paramName = "";
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "isValidParam",
+ new Object[] { List.class, methodName, paramName });
+ }
+
+ @Test
+ public void testIsValidObject() throws Exception {
+ DistributionEngine testSubject;
+ Object paramValue = null;
+ String methodName = "";
+ String paramName = "";
+ boolean result;
+
+ // test 1
+ testSubject = createTestSubject();
+ paramValue = null;
+ result = Deencapsulation.invoke(testSubject, "isValidObject",
+ new Object[] { Object.class, methodName, paramName });
+ Assert.assertEquals(false, result);
+ }
+
+ @Test
+ public void testGetEnvironmentErrorDescription() throws Exception {
+ DistributionEngine testSubject;
+ StorageOperationStatus status = null;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "getEnvironmentErrorDescription",
+ StorageOperationStatus.DISTR_ENVIRONMENT_NOT_AVAILABLE);
+ result = Deencapsulation.invoke(testSubject, "getEnvironmentErrorDescription",
+ StorageOperationStatus.DISTR_ENVIRONMENT_NOT_FOUND);
+ result = Deencapsulation.invoke(testSubject, "getEnvironmentErrorDescription",
+ StorageOperationStatus.DISTR_ENVIRONMENT_SENT_IS_INVALID);
+ result = Deencapsulation.invoke(testSubject, "getEnvironmentErrorDescription",
+ StorageOperationStatus.ARTIFACT_NOT_FOUND);
+ }
+
+ @Test
+ public void testIsEnvironmentAvailable() throws Exception {
+ DistributionEngine testSubject;
+ String envName = "";
+ StorageOperationStatus result;
+
+ // test 1
+ testSubject = createTestSubject();
+ envName = null;
+ result = testSubject.isEnvironmentAvailable(envName);
+ Assert.assertEquals(StorageOperationStatus.DISTR_ENVIRONMENT_SENT_IS_INVALID, result);
+
+ // test 2
+ testSubject = createTestSubject();
+ envName = "mock";
+ result = testSubject.isEnvironmentAvailable(envName);
+ Assert.assertEquals(StorageOperationStatus.DISTR_ENVIRONMENT_NOT_FOUND, result);
+ }
+
+ //TODO Create test coverage for this method
+ /*@Test
+ public void testIsEnvironmentAvailable_1() throws Exception {
+ DistributionEngine testSubject;
+ StorageOperationStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testInstance.isEnvironmentAvailable();
+ }*/
+
+ @Test(expected=NullPointerException.class)
+ public void testDisableEnvironment() throws Exception {
+ DistributionEngine testSubject;
+ String envName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.disableEnvironment(envName);
+ }
+
+ @Test
+ public void testBuildTopicName() throws Exception {
+ DistributionEngine testSubject;
+ String envName = "";
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "buildTopicName", new Object[] { envName });
+ }
+
+ @Test
+ public void testIsReadyForDistribution() throws Exception {
+ DistributionEngine testSubject;
+ Service service = null;
+ String envName = "";
+ StorageOperationStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isReadyForDistribution(service, envName);
+ }
+
+ @Test
+ public void testVerifyServiceHasDeploymentArtifactsTrue() throws Exception {
+ Service service = new Service();
+ StorageOperationStatus result;
+
+ // default test
+ when(serviceDistributionArtifactsBuilder.verifyServiceContainsDeploymentArtifacts(ArgumentMatchers.any(Service.class))).thenReturn(true);
+ result = testInstance.verifyServiceHasDeploymentArtifacts(service);
+ }
+
+ @Test
+ public void testVerifyServiceHasDeploymentArtifactsFalse() throws Exception {
+ Service service = new Service();
+ StorageOperationStatus result;
+
+ // default test
+ when(serviceDistributionArtifactsBuilder.verifyServiceContainsDeploymentArtifacts(ArgumentMatchers.any(Service.class))).thenReturn(false);
+ result = testInstance.verifyServiceHasDeploymentArtifacts(service);
+ }
+
+ @Test
+ public void testGetEnvironmentById() throws Exception {
+ DistributionEngine testSubject;
+ String opEnvId = "";
+ OperationalEnvironmentEntry result;
+
+ // default test
+ when(environmentsEngine.getEnvironmentById(ArgumentMatchers.anyString())).thenReturn(new OperationalEnvironmentEntry());
+ result = testInstance.getEnvironmentById(opEnvId);
+ }
+
+ @Test
+ public void testBuildServiceForDistribution() throws Exception {
+ Service service = new Service();
+ String distributionId = "";
+ String workloadContext = "";
+ INotificationData result;
-public class DistributionEngineTest {
-
- public static final String DISTRIBUTION_ID = "distId";
- public static final String ENV_ID = "envId";
- public static final String USER_ID = "userId";
- public static final String MODIFIER = "modifier";
-
- @InjectMocks
- private DistributionEngine testInstance;
-
- @Mock
- private EnvironmentsEngine environmentsEngine;
-
- @Mock
- private DistributionNotificationSender distributionNotificationSender;
-
- private DummyDistributionConfigurationManager distributionEngineConfigurationMock;
-
- private Map<String, OperationalEnvironmentEntry> envs;
-
-
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
- distributionEngineConfigurationMock = new DummyDistributionConfigurationManager();
- envs = getEnvs(ENV_ID);
- }
-
- @Test
- public void notifyService() throws Exception {
- NotificationDataImpl notificationData = new NotificationDataImpl();
- Service service = new Service();
- when(environmentsEngine.getEnvironmentById(ENV_ID)).thenReturn(envs.get(ENV_ID));
- when(distributionEngineConfigurationMock.getConfigurationMock().getDistributionNotifTopicName()).thenReturn("topic");
- when(distributionNotificationSender.sendNotification(eq("topic-ENVID"), eq(DISTRIBUTION_ID), any(EnvironmentMessageBusData.class),
- any(NotificationDataImpl.class), any(Service.class), eq(USER_ID), eq(MODIFIER)))
- .thenReturn(ActionStatus.OK);
- ActionStatus actionStatus = testInstance.notifyService(DISTRIBUTION_ID, service, notificationData, ENV_ID, USER_ID, MODIFIER);
- assertEquals(ActionStatus.OK, actionStatus);
- }
-
- @Test
- public void notifyService_couldNotResolveEnvironment() throws Exception {
- when(environmentsEngine.getEnvironments()).thenReturn(envs);
- ActionStatus actionStatus = testInstance.notifyService(DISTRIBUTION_ID, new Service(), new NotificationDataImpl(), "someNonExisitngEnv", USER_ID, MODIFIER);
- assertEquals(ActionStatus.DISTRIBUTION_ENVIRONMENT_NOT_AVAILABLE, actionStatus);
- verifyZeroInteractions(distributionNotificationSender);
- }
-
- @Test
- public void notifyService_failedWhileSendingNotification() throws Exception {
- NotificationDataImpl notificationData = new NotificationDataImpl();
- Service service = new Service();
- when(environmentsEngine.getEnvironmentById(ENV_ID)).thenReturn(envs.get(ENV_ID));
- when(distributionEngineConfigurationMock.getConfigurationMock().getDistributionNotifTopicName()).thenReturn("topic");
- when(distributionNotificationSender.sendNotification(eq("topic-ENVID"), eq(DISTRIBUTION_ID), any(EnvironmentMessageBusData.class),
- any(NotificationDataImpl.class), any(Service.class), eq(USER_ID), eq(MODIFIER)))
- .thenReturn(ActionStatus.GENERAL_ERROR);
- ActionStatus actionStatus = testInstance.notifyService(DISTRIBUTION_ID, service, notificationData, ENV_ID, USER_ID, MODIFIER);
- assertEquals(ActionStatus.GENERAL_ERROR, actionStatus);
- }
-
- private Map<String, OperationalEnvironmentEntry> getEnvs(String ... environmentIds) {
- Set<String> uebAddress = new HashSet<>();
- uebAddress.add("someAddress");
- return Stream.of(environmentIds)
- .map(id -> new OperationalEnvironmentBuilder().setEnvId(id).setDmaapUebAddress(uebAddress).build())
- .collect(Collectors.toMap(OperationalEnvironmentEntry::getEnvironmentId, Function.identity()));
- }
+ // default test
+ //testSubject = createTestSubject();
+ when(serviceDistributionArtifactsBuilder.buildResourceInstanceForDistribution(ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any())).thenReturn(new NotificationDataImpl());
+ result = testInstance.buildServiceForDistribution(service, distributionId, workloadContext);
+ }
}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import org.junit.Test;
+
+public class DistributionStatusNotificationTest {
+
+ private DistributionStatusNotification createTestSubject() {
+ return new DistributionStatusNotification();
+ }
+
+ @Test
+ public void testGetDistributionID() throws Exception {
+ DistributionStatusNotification testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDistributionID();
+ }
+
+ @Test
+ public void testSetDistributionID() throws Exception {
+ DistributionStatusNotification testSubject;
+ String distributionId = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setDistributionID(distributionId);
+ }
+
+ @Test
+ public void testGetConsumerID() throws Exception {
+ DistributionStatusNotification testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getConsumerID();
+ }
+
+ @Test
+ public void testSetConsumerID() throws Exception {
+ DistributionStatusNotification testSubject;
+ String consumerId = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setConsumerID(consumerId);
+ }
+
+ @Test
+ public void testGetTimestamp() throws Exception {
+ DistributionStatusNotification testSubject;
+ long result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getTimestamp();
+ }
+
+ @Test
+ public void testSetTimestamp() throws Exception {
+ DistributionStatusNotification testSubject;
+ long timestamp = 4354;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setTimestamp(timestamp);
+ }
+
+ @Test
+ public void testGetArtifactURL() throws Exception {
+ DistributionStatusNotification testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifactURL();
+ }
+
+ @Test
+ public void testSetArtifactURL() throws Exception {
+ DistributionStatusNotification testSubject;
+ String artifactURL = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifactURL(artifactURL);
+ }
+
+ @Test
+ public void testGetStatus() throws Exception {
+ DistributionStatusNotification testSubject;
+ DistributionStatusNotificationEnum result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getStatus();
+ }
+
+ @Test
+ public void testSetStatus() throws Exception {
+ DistributionStatusNotification testSubject;
+ DistributionStatusNotificationEnum status = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setStatus(status);
+ }
+
+ @Test
+ public void testGetErrorReason() throws Exception {
+ DistributionStatusNotification testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getErrorReason();
+ }
+
+ @Test
+ public void testSetErrorReason() throws Exception {
+ DistributionStatusNotification testSubject;
+ String errorReason = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setErrorReason(errorReason);
+ }
+
+ @Test
+ public void testIsDistributionCompleteNotification() throws Exception {
+ DistributionStatusNotification testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isDistributionCompleteNotification();
+
+ testSubject.status = DistributionStatusNotificationEnum.DISTRIBUTION_COMPLETE_OK;
+ result = testSubject.isDistributionCompleteNotification();
+
+ testSubject.status = DistributionStatusNotificationEnum.DISTRIBUTION_COMPLETE_ERROR;
+ result = testSubject.isDistributionCompleteNotification();
+ }
+
+ @Test
+ public void testToString() throws Exception {
+ DistributionStatusNotification testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.toString();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import java.io.File;
+import java.security.GeneralSecurityException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.config.DmaapConsumerConfiguration;
+import org.openecomp.sdc.be.config.DmaapConsumerConfiguration.Credential;
+
+import com.att.nsa.mr.client.MRConsumer;
+
+import mockit.Deencapsulation;
+
+public class DmaapClientFactoryTest {
+
+ private DmaapClientFactory createTestSubject() {
+ return new DmaapClientFactory();
+ }
+
+ @Test
+ public void testCreate() throws Exception {
+ DmaapClientFactory testSubject;
+ DmaapConsumerConfiguration parameters = new DmaapConsumerConfiguration();
+ MRConsumer result;
+ String filePath = "src/test/resources/config/mock.txt";
+
+ Credential credential = new Credential();
+ credential.setPassword("hmXYcznAljMSisdy8zgcag==");
+ credential.setUsername("mock");
+ parameters.setCredential(credential);
+ parameters.setLatitude(new Double(32452));
+ parameters.setLongitude(new Double(543534));
+ parameters.setVersion("mock");
+ parameters.setServiceName("mock");
+ parameters.setServiceName("mock");
+ parameters.setEnvironment("mock");
+ parameters.setPartner("mock");
+ parameters.setRouteOffer("mock");
+ parameters.setProtocol("mock");
+ parameters.setContenttype("mock");
+ parameters.setHosts("mock");
+ parameters.setTopic("mock");
+ parameters.setConsumerGroup("mock");
+ parameters.setConsumerId("mock");
+ parameters.setTimeoutMs(42354);
+ parameters.setLimit(43534);
+ parameters.setDme2TraceOn(true);
+ parameters.setAftEnvironment("mock");
+ parameters.setAftDme2ConnectionTimeoutMs(234324);
+ parameters.setAftDme2RoundtripTimeoutMs(435345);
+ parameters.setAftDme2ReadTimeoutMs(5645);
+ parameters.setDme2preferredRouterFilePath(filePath);
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.create(parameters);
+ File file = new File(filePath);
+ file.delete();
+
+ }
+
+ @Test
+ public void testBuildProperties() throws Exception {
+ DmaapClientFactory testSubject;
+ DmaapConsumerConfiguration parameters = new DmaapConsumerConfiguration();
+ Properties result;
+ String filePath = "src/test/resources/config/mock.txt";
+
+ Credential credential = new Credential();
+ credential.setPassword("hmXYcznAljMSisdy8zgcag==");
+ credential.setUsername("mock");
+ parameters.setCredential(credential);
+ parameters.setLatitude(new Double(32452));
+ parameters.setLongitude(new Double(543534));
+ parameters.setVersion("mock");
+ parameters.setServiceName("mock");
+ parameters.setServiceName("mock");
+ parameters.setEnvironment("mock");
+ parameters.setPartner("mock");
+ parameters.setRouteOffer("mock");
+ parameters.setProtocol("mock");
+ parameters.setContenttype("mock");
+ parameters.setHosts("mock");
+ parameters.setTopic("mock");
+ parameters.setConsumerGroup("mock");
+ parameters.setConsumerId("mock");
+ parameters.setTimeoutMs(42354);
+ parameters.setLimit(43534);
+ parameters.setDme2TraceOn(true);
+ parameters.setAftEnvironment("mock");
+ parameters.setAftDme2ConnectionTimeoutMs(234324);
+ parameters.setAftDme2RoundtripTimeoutMs(435345);
+ parameters.setAftDme2ReadTimeoutMs(5645);
+ parameters.setDme2preferredRouterFilePath(filePath);
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "buildProperties", parameters);
+
+ File file = new File(filePath);
+ file.delete();
+ }
+
+ @Test(expected = GeneralSecurityException.class)
+ public void testBuildProperties_2() throws Exception {
+ DmaapClientFactory testSubject;
+ DmaapConsumerConfiguration parameters = new DmaapConsumerConfiguration();
+ Properties result;
+ String filePath = "src/test/resources/config/mock.txt";
+
+ Credential credential = new Credential();
+ credential.setPassword("mock");
+ parameters.setCredential(credential);
+
+ // default test
+ testSubject = createTestSubject();
+ result = Deencapsulation.invoke(testSubject, "buildProperties", parameters);
+ }
+
+ @Test
+ public void testEnsureFileExists() throws Exception {
+ DmaapClientFactory testSubject;
+ String filePath = "src/test/resources/config/mock.txt";
+
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "ensureFileExists", new Object[] { filePath });
+ Deencapsulation.invoke(testSubject, "ensureFileExists", filePath);
+ File file = new File(filePath);
+ file.delete();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import java.lang.Thread.UncaughtExceptionHandler;
+import java.util.function.Consumer;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.components.BeConfDependentTest;
+
+public class DmaapConsumerTest extends BeConfDependentTest{
+
+ private DmaapConsumer createTestSubject() {
+ return new DmaapConsumer(new ExecutorFactory(), new DmaapClientFactory());
+ }
+
+ @Test
+ public void testConsumeDmaapTopic() throws Exception {
+ DmaapConsumer testSubject;
+ Consumer<String> notificationReceived = null;
+ UncaughtExceptionHandler exceptionHandler = new UncaughtExceptionHandlerMock();
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.consumeDmaapTopic(notificationReceived, exceptionHandler);
+ }
+
+ private class UncaughtExceptionHandlerMock implements UncaughtExceptionHandler{
+
+ @Override
+ public void uncaughtException(Thread t, Throwable e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import java.net.URISyntaxException;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.components.BeConfDependentTest;
+import org.openecomp.sdc.be.config.DmaapConsumerConfiguration;
+import org.openecomp.sdc.common.api.HealthCheckInfo;
+
+import mockit.Deencapsulation;
+
+public class DmaapHealthTest extends BeConfDependentTest{
+
+ private DmaapHealth createTestSubject() {
+ return new DmaapHealth();
+ }
+
+ @Test
+ public void testInit() throws Exception {
+ DmaapHealth testSubject;
+ DmaapHealth result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.init();
+ }
+
+ @Test
+ public void testDestroy() throws Exception {
+ DmaapHealth testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ Deencapsulation.invoke(testSubject, "destroy");
+ }
+
+ @Test
+ public void testStartHealthCheckTask() throws Exception {
+ DmaapHealth testSubject;
+ boolean startTask = false;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.startHealthCheckTask(startTask);
+ }
+
+ @Test
+ public void testReport() throws Exception {
+ DmaapHealth testSubject;
+ Boolean isUp = false;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.report(isUp);
+ }
+
+ @Test
+ public void testLogAlarm() throws Exception {
+ DmaapHealth testSubject;
+ boolean lastHealthState = false;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.logAlarm(lastHealthState);
+ }
+
+ @Test
+ public void testGetConfiguration() throws Exception {
+ DmaapHealth testSubject;
+ DmaapConsumerConfiguration result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getConfiguration();
+ }
+
+ @Test
+ public void testGetHealthCheckInfo() throws Exception {
+ DmaapHealth testSubject;
+ HealthCheckInfo result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getHealthCheckInfo();
+ }
+
+ @Test(expected=URISyntaxException.class)
+ public void testGetUrlHost() throws Exception {
+ String qualifiedHost = "";
+ String result;
+
+ // default test
+ result = DmaapHealth.getUrlHost(qualifiedHost);
+ }
+
+ @Test
+ public void testGetUrlHost_2() throws Exception {
+ String qualifiedHost = "www.mock.com";
+ String result;
+
+ // default test
+ result = DmaapHealth.getUrlHost(qualifiedHost);
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import org.junit.Test;
+
+public class DmaapNotificationDataImplTest {
+
+ private DmaapNotificationDataImpl createTestSubject() {
+ return new DmaapNotificationDataImpl();
+ }
+
+ @Test
+ public void testGetOperationalEnvironmentId() throws Exception {
+ DmaapNotificationDataImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getOperationalEnvironmentId();
+ }
+
+ @Test
+ public void testGetOperationalEnvironmentName() throws Exception {
+ DmaapNotificationDataImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getOperationalEnvironmentName();
+ }
+
+ @Test
+ public void testGetTenantContext() throws Exception {
+ DmaapNotificationDataImpl testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getTenantContext();
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import java.util.HashSet;
+import java.util.List;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
+
+public class EnvironmentMessageBusDataTest {
+
+ private EnvironmentMessageBusData createTestSubject() {
+ return new EnvironmentMessageBusData();
+ }
+
+ @Test
+ public void testConstructor() throws Exception {
+ OperationalEnvironmentEntry operationalEnvironment = new OperationalEnvironmentEntry();
+ operationalEnvironment.setDmaapUebAddress(new HashSet<>());
+ new EnvironmentMessageBusData(operationalEnvironment);
+ }
+
+ @Test
+ public void testGetTenant() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getTenant();
+ }
+
+ @Test
+ public void testSetTenant() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ String tenant = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setTenant(tenant);
+ }
+
+ @Test
+ public void testGetDmaaPuebEndpoints() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ List<String> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDmaaPuebEndpoints();
+ }
+
+ @Test
+ public void testSetDmaaPuebEndpoints() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ List<String> dmaaPuebEndpoints = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setDmaaPuebEndpoints(dmaaPuebEndpoints);
+ }
+
+ @Test
+ public void testGetUebPublicKey() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getUebPublicKey();
+ }
+
+ @Test
+ public void testSetUebPublicKey() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ String uebPublicKey = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setUebPublicKey(uebPublicKey);
+ }
+
+ @Test
+ public void testGetUebPrivateKey() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getUebPrivateKey();
+ }
+
+ @Test
+ public void testSetUebPrivateKey() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ String uebPrivateKey = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setUebPrivateKey(uebPrivateKey);
+ }
+
+ @Test
+ public void testGetEnvId() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getEnvId();
+ }
+
+ @Test
+ public void testSetEnvId() throws Exception {
+ EnvironmentMessageBusData testSubject;
+ String envId = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setEnvId(envId);
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.openecomp.sdc.be.components.distribution.engine;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.HttpStatus;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.config.ConfigurationManager;
+import org.openecomp.sdc.be.config.DistributionEngineConfiguration;
+import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
+import org.openecomp.sdc.be.dao.cassandra.OperationalEnvironmentDao;
+import org.openecomp.sdc.be.datatypes.enums.EnvironmentStatusEnum;
+import org.openecomp.sdc.be.info.OperationalEnvInfo;
+import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
+import org.openecomp.sdc.common.http.client.api.HttpResponse;
+
+import fj.data.Either;
+
+@RunWith(value = MockitoJUnitRunner.class)
+public class EnvironmentsEngineMockTest {
+
+ @InjectMocks
+ private EnvironmentsEngine envEngine;
+ @Mock
+ private DmaapConsumer dmaapConsumer;
+ @Mock
+ private OperationalEnvironmentDao operationalEnvironmentDao;
+ @Mock
+ private DME2EndpointIteratorCreator epIterCreator;
+ @Mock
+ private ConfigurationManager configurationManager;
+ @Mock
+ private DistributionEngineConfiguration distributionEngineConfiguration;
+ @Mock
+ private AaiRequestHandler aaiRequestHandler;
+
+ @Before
+ public void preStart() {
+ when(configurationManager.getDistributionEngineConfiguration()).thenReturn(distributionEngineConfiguration);
+ envEngine.setConfigurationManager(configurationManager);
+ }
+
+ @Test
+ public void testInit() {
+ List<OperationalEnvironmentEntry> entryList = Arrays.asList(createOpEnvEntry("Env1"), createOpEnvEntry("Env2"));
+ Either<List<OperationalEnvironmentEntry>, CassandraOperationStatus> successEither = Either.left(entryList);
+ when(operationalEnvironmentDao.getByEnvironmentsStatus(EnvironmentStatusEnum.COMPLETED)).thenReturn(successEither);
+
+ when(distributionEngineConfiguration.getEnvironments()).thenReturn(Arrays.asList("Env Loaded From Configuration"));
+ when(distributionEngineConfiguration.getUebPublicKey()).thenReturn("Dummy Public Key");
+ when(distributionEngineConfiguration.getUebSecretKey()).thenReturn("Dummy Private Key");
+ when(distributionEngineConfiguration.getUebServers()).thenReturn(
+ Arrays.asList("uebsb91kcdc.it.att.com:3904", "uebsb92kcdc.it.att.com:3904", "uebsb91kcdc.it.att.com:3904"));
+
+ envEngine.init();
+
+ Map<String, OperationalEnvironmentEntry> mapEnvs = envEngine.getEnvironments();
+ assertEquals("unexpected size of map",3, mapEnvs.size());
+ }
+
+
+ @Test
+ public void testGetFullOperationalEnvByIdSuccess() {
+ String json = getFullOperationalEnvJson();
+
+ HttpResponse<String> restResponse = new HttpResponse<String>(json, HttpStatus.SC_OK, "Successfully completed");
+ when(aaiRequestHandler.getOperationalEnvById(Mockito.anyString())).thenReturn(restResponse);
+
+ Either<OperationalEnvInfo, Integer> response = envEngine.getOperationalEnvById("DummyId");
+ assertTrue("The operational environment request ran as not expected", response.isLeft());
+
+ OperationalEnvInfo operationalEnvInfo = response.left().value();
+
+ assertEquals("The operational environment json is not as expected", operationalEnvInfo.toString(), json);
+ }
+
+ @Test
+ public void testGetPartialOperationalEnvByIdSuccess() {
+ String json = getPartialOperationalEnvJson();
+
+ HttpResponse<String> restResponse = new HttpResponse<String>(json, HttpStatus.SC_OK, "Successfully completed");
+ when(aaiRequestHandler.getOperationalEnvById(Mockito.anyString())).thenReturn(restResponse);
+
+ Either<OperationalEnvInfo, Integer> response = envEngine.getOperationalEnvById("DummyId");
+ assertTrue("The operational environment request ran as not expected", response.isLeft());
+
+ OperationalEnvInfo operationalEnvInfo = response.left().value();
+
+ assertEquals("The operational environment json is not as expected", operationalEnvInfo.toString(), json);
+ }
+
+
+ @Test
+ public void testGetOperationalEnvByIdFailedByJsonConvert() {
+ String jsonCorrupted = getCorruptedOperationalEnvJson();
+
+ HttpResponse<String> restResponse = new HttpResponse<String>(jsonCorrupted, HttpStatus.SC_OK, "Successfully Completed");
+ when(aaiRequestHandler.getOperationalEnvById(Mockito.anyString())).thenReturn(restResponse);
+
+ Either<OperationalEnvInfo, Integer> response = envEngine.getOperationalEnvById("DummyId");
+ assertTrue("The operational environment request ran as not expected", response.isRight());
+ assertEquals("The operational environment request status code is not as expected", (Integer)HttpStatus.SC_INTERNAL_SERVER_ERROR, response.right().value());
+ }
+
+ @Test
+ public void testGetOperationalEnvByIdFailed404() {
+ String json = getFullOperationalEnvJson();
+ HttpResponse<String> restResponse = new HttpResponse<String>(json, HttpStatus.SC_NOT_FOUND, "Not Found");
+ when(aaiRequestHandler.getOperationalEnvById(Mockito.anyString())).thenReturn(restResponse);
+
+ Either<OperationalEnvInfo, Integer> response = envEngine.getOperationalEnvById("DummyId");
+ assertTrue("The operational environment request ran as not expected", response.isRight());
+ assertEquals("The operational environment request status code is not as expected", (Integer)HttpStatus.SC_NOT_FOUND, response.right().value());
+ }
+
+
+ @Test(expected = IOException.class)
+ public void testCorruptedOperationalEnvJson() throws IOException {
+ String jsonCorrupted = getCorruptedOperationalEnvJson();
+ OperationalEnvInfo.createFromJson(jsonCorrupted);
+ }
+
+ private String getCorruptedOperationalEnvJson() {
+ return "{\"OPERATIONAL-environment-name\":\"Op Env Name\","
+ + "\"OPERATIONAL-environment-type\":\"VNF\","
+ + "\"OPERATIONAL-environment-status\":\"Activate\","
+ + "\"tenant-context\":\"Test\"}";
+ }
+
+ private String getPartialOperationalEnvJson() {
+ return "{" +
+ "\"operational-environment-id\":\"UUID of Operational Environment\"," +
+ "\"operational-environment-name\":\"Op Env Name\"," +
+ "\"operational-environment-type\":\"VNF\"," +
+ "\"operational-environment-status\":\"Activate\"," +
+ "\"tenant-context\":\"Test\"," +
+ "\"workload-context\":\"VNF_Development\"," +
+ "\"resource-version\":\"1505228226913\"," +
+ "\"relationship-list\":{" +
+ "\"relationship\":[]" +
+ "}" +
+ "}";
+ }
+
+ private String getFullOperationalEnvJson() {
+ return "{" +
+ "\"operational-environment-id\":\"OEid1\"," +
+ "\"operational-environment-name\":\"OEname1\"," +
+ "\"operational-environment-type\":\"OEtype1\"," +
+ "\"operational-environment-status\":\"OEstatus1\"," +
+ "\"tenant-context\":\"OEtenantcontext1\"," +
+ "\"workload-context\":\"OEworkloadcontext1\"," +
+ "\"resource-version\":\"1511363173278\"," +
+ "\"relationship-list\":{" +
+ "\"relationship\":[" +
+ "{" +
+ "\"related-to\":\"operational-environment\"," +
+ "\"relationship-label\":\"managedBy\"," +
+ "\"related-link\":\"/aai/v12/cloud-infrastructure/operational-environments/operational-environment/OEid3\"," +
+ "\"relationship-data\":[" +
+ "{" +
+ "\"relationship-key\":\"operational-environment.operational-environment-id\"," +
+ "\"relationship-value\":\"OEid3\"" +
+ "}" +
+ "]," +
+ "\"related-to-property\":[" +
+ "{" +
+ "\"property-key\":\"operational-environment.operational-environment-name\"," +
+ "\"property-value\":\"OEname3\"" +
+ "}]}]}}";
+ }
+
+ private OperationalEnvironmentEntry createOpEnvEntry(String name) {
+ OperationalEnvironmentEntry entry = new OperationalEnvironmentEntry();
+ entry.setEnvironmentId(name);
+ return entry;
+ }
+
+}
package org.openecomp.sdc.be.components.distribution.engine;
-import javax.annotation.Generated;
-
-import org.junit.Assert;
import org.junit.Test;
-import org.mockito.Mockito;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.model.operations.impl.InterfaceLifecycleOperation;
package org.openecomp.sdc.be.components.distribution.engine;
-import com.att.aft.dme2.api.DME2Exception;
-import com.att.aft.dme2.iterator.DME2EndpointIterator;
-import com.att.nsa.apiClient.credentials.ApiCredential;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import cucumber.api.java.Before;
-import cucumber.api.java.en.Given;
-import cucumber.api.java.en.Then;
-import cucumber.api.java.en.When;
-import fj.data.Either;
+import static java.util.Objects.isNull;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
import org.apache.commons.lang.NotImplementedException;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.http.HttpStatus;
import org.openecomp.sdc.common.datastructure.Wrapper;
import org.openecomp.sdc.common.http.client.api.HttpResponse;
-import static java.util.Objects.isNull;
-import static org.apache.commons.lang3.StringUtils.isEmpty;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import com.att.aft.dme2.api.DME2Exception;
+import com.att.aft.dme2.iterator.DME2EndpointIterator;
+import com.att.nsa.apiClient.credentials.ApiCredential;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import cucumber.api.java.Before;
+import cucumber.api.java.en.Given;
+import cucumber.api.java.en.Then;
+import cucumber.api.java.en.When;
+import fj.data.Either;
public class StepsTenantIsolation {
package org.openecomp.sdc.be.components.distribution.engine.rest;
-import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
-import com.github.tomakehurst.wiremock.junit.WireMockRule;
-import com.github.tomakehurst.wiremock.matching.AnythingPattern;
-import com.github.tomakehurst.wiremock.matching.UrlPattern;
-import fj.data.Either;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath;
+import static com.github.tomakehurst.wiremock.client.WireMock.patch;
+import static com.github.tomakehurst.wiremock.client.WireMock.patchRequestedFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import static com.github.tomakehurst.wiremock.client.WireMock.verify;
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.when;
+
import org.apache.http.HttpHeaders;
import org.junit.Before;
import org.junit.ClassRule;
import org.openecomp.sdc.be.components.distribution.engine.DummyDistributionConfigurationManager;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.common.http.client.api.HttpResponse;
-import org.openecomp.sdc.common.http.config.*;
+import org.openecomp.sdc.common.http.config.BasicAuthorization;
+import org.openecomp.sdc.common.http.config.ExternalServiceConfig;
+import org.openecomp.sdc.common.http.config.HttpClientConfig;
+import org.openecomp.sdc.common.http.config.HttpRequestConfig;
+import org.openecomp.sdc.common.http.config.Timeouts;
import org.openecomp.sdc.security.SecurityUtil;
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
-import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.when;
+import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
+import com.github.tomakehurst.wiremock.matching.AnythingPattern;
+import com.github.tomakehurst.wiremock.matching.UrlPattern;
+
+import fj.data.Either;
public class MsoRestClientTest {
package org.openecomp.sdc.be.components.health;
-import static org.junit.Assert.*;
-import java.util.*;
+import java.util.List;
+
import org.junit.Assert;
import org.junit.Test;
import org.openecomp.sdc.common.api.HealthCheckInfo;
-import org.apache.commons.lang3.tuple.Pair;
public class HealthCheckBusinessLogicTest {
package org.openecomp.sdc.be.components.impl;
-import java.util.List;
-
-import javax.servlet.ServletContext;
-
import org.junit.Test;
import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterInfo;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.model.AdditionalInformationDefinition;
-import org.openecomp.sdc.be.model.operations.api.IElementOperation;
import org.openecomp.sdc.exception.ResponseFormat;
import fj.data.Either;
-import java.util.*;
-import org.junit.Assert;
public class AdditionalInformationBusinessLogicTest {
package org.openecomp.sdc.be.components.impl;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonElement;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.HEAT_ENV_NAME;
+import static org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.HEAT_VF_ENV_NAME;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonElement;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import static org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.HEAT_ENV_NAME;
-import static org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.HEAT_VF_ENV_NAME;
+import fj.data.Either;
public class ArtifactBusinessLogicTest {
package org.openecomp.sdc.be.components.impl;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
public class ArtifactResolverTest {
private ArtifactResolverImpl testInstance = new ArtifactResolverImpl();
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openecomp.sdc.common.util.CapabilityTypeNameEnum;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class CapabilityTypeImportManagerTest {
@InjectMocks
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openecomp.sdc.be.model.operations.api.IElementOperation;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class CategoriesImportManagerTest {
@InjectMocks
import org.assertj.core.util.Lists;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.impl.ServletUtils;
-import org.openecomp.sdc.be.info.CreateAndAssotiateInfo;
import org.openecomp.sdc.be.model.CapabilityDefinition;
import org.openecomp.sdc.be.model.CapabilityRequirementRelationship;
import org.openecomp.sdc.be.model.Component;
package org.openecomp.sdc.be.components.impl;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
-import org.openecomp.sdc.be.auditing.impl.AuditBaseEventFactory;
-import org.openecomp.sdc.be.auditing.impl.AuditingManager;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.resources.data.auditing.DistributionDownloadEvent;
-import org.openecomp.sdc.be.resources.data.auditing.EcompOperationalEnvironmentEvent;
-import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent;
-import org.openecomp.sdc.be.resources.data.auditing.UserAdminEvent;
-import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
-import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
-import org.openecomp.sdc.common.util.ThreadLocalsHolder;
-import org.openecomp.sdc.exception.ResponseFormat;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.USER_ID;
import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.USER_LAST_NAME;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
+import org.openecomp.sdc.be.auditing.impl.AuditBaseEventFactory;
+import org.openecomp.sdc.be.auditing.impl.AuditingManager;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.impl.ComponentsUtils;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.be.resources.data.auditing.DistributionDownloadEvent;
+import org.openecomp.sdc.be.resources.data.auditing.EcompOperationalEnvironmentEvent;
+import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent;
+import org.openecomp.sdc.be.resources.data.auditing.UserAdminEvent;
+import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
+import org.openecomp.sdc.common.util.ThreadLocalsHolder;
+import org.openecomp.sdc.exception.ResponseFormat;
+
@RunWith(MockitoJUnitRunner.class)
public class ComponentsUtilsTest {
package org.openecomp.sdc.be.components.impl;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.junit.Test;
-import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.unittests.utils.FactoryUtils;
+import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import java.util.stream.Collectors;
-import static org.junit.Assert.assertTrue;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.junit.Test;
+import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.unittests.utils.FactoryUtils;
public class CompositionBusinessLogicTest {
CompositionBusinessLogic compBl = new CompositionBusinessLogic();
package org.openecomp.sdc.be.components.impl;
+import java.util.Arrays;
+
import org.junit.Assert;
import org.junit.Test;
-import java.util.Arrays;
-
public class CsarValidationUtilsTest {
private String[] invalidExtensions = { null, ".bla", ".yaml", ".yml", ".txt", ".zip" };
private String[] validExtensions = { ".csar", ".cSAr", ".Csar", ".CSAR" };
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.resources.data.category.CategoryData;
import org.openecomp.sdc.common.util.ValidationUtils;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
/**
* Created by chaya on 12/7/2017.
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
-import org.junit.Test;
-import org.openecomp.sdc.be.components.impl.ImportUtils.ResultStatusEnum;
-import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaElementTypeEnum;
-import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
-import org.openecomp.sdc.be.model.HeatParameterDefinition;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-import org.openecomp.sdc.common.api.ArtifactTypeEnum;
-import org.yaml.snakeyaml.Yaml;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.util.Map;
import java.util.Map.Entry;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.openecomp.sdc.be.components.impl.ImportUtils.ResultStatusEnum;
+import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaElementTypeEnum;
+import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
+import org.openecomp.sdc.be.model.HeatParameterDefinition;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.common.api.ArtifactTypeEnum;
+import org.yaml.snakeyaml.Yaml;
+
+import fj.data.Either;
public class ImportUtilsTest {
@Test
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.user.IUserBusinessLogic;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class InputsBusinessLogicTest {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.List;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class InterfaceLifecycleTypeImportManagerTest {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyCollection;
+import static org.mockito.ArgumentMatchers.anyObject;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.servlet.ServletContext;
+
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.mockito.ArgumentMatchers.anyCollection;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.anyObject;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class InterfaceOperationBusinessLogicTest implements InterfaceOperationTestUtils{
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.assertj.core.api.Java6Assertions.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyMap;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Java6Assertions.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.anyMap;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class PolicyBusinessLogicTest {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+
+import javax.ws.rs.core.Response;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.exception.ResponseFormat;
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class PolicyPropertiesBusinessLogicTest {
package org.openecomp.sdc.be.components.impl;
-import com.google.common.collect.ImmutableMap;
-import fj.data.Either;
+import static com.google.common.collect.Sets.newHashSet;
+import static java.util.Collections.emptyList;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openecomp.sdc.be.model.operations.impl.PolicyTypeOperation;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
+import com.google.common.collect.ImmutableMap;
-import static com.google.common.collect.Sets.newHashSet;
-import static java.util.Collections.emptyList;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class PolicyTypeBusinessLogicTest {
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyObject;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.servlet.ServletContext;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.junit.Before;
import org.junit.Ignore;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
-import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
-import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.DataTypeDefinition;
import org.openecomp.sdc.be.model.InputDefinition;
-import org.openecomp.sdc.be.model.InterfaceDefinition;
import org.openecomp.sdc.be.model.LifeCycleTransitionEnum;
import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Operation;
import org.openecomp.sdc.be.model.PropertyDefinition;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.User;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyCollection;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.anyObject;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ResourceBusinessLogicTest implements InterfaceOperationTestUtils{
package org.openecomp.sdc.be.components.impl;
-import fj.data.Either;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class ResourceInstanceBusinessLogicTest {
package org.openecomp.sdc.be.components.impl.generic;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class GenericTypeBusinessLogicTest {
package org.openecomp.sdc.be.components.impl.utils;
-import com.google.common.collect.ImmutableMap;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
import org.junit.Test;
import org.openecomp.sdc.be.components.utils.PolicyTypeBuilder;
import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
import org.openecomp.sdc.be.model.tosca.constraints.GreaterThanConstraint;
import org.openecomp.sdc.be.model.tosca.constraints.MinLengthConstraint;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
+import com.google.common.collect.ImmutableMap;
public class PolicyTypeImportUtilsTest {
package org.openecomp.sdc.be.components.impl.version;
-import fj.data.Either;
+import static java.util.Collections.emptyMap;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.jsontitan.operations.GroupsOperation;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Stream;
-
-import static java.util.Collections.emptyMap;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class GroupMembersUpdateOperationTest {
package org.openecomp.sdc.be.components.impl.version;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.anyList;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.be.components.impl.utils.TestGenerationUtils.getComponentsUtils;
+
+import java.util.List;
+import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.List;
-import java.util.stream.Stream;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.anyList;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-import static org.openecomp.sdc.be.components.impl.utils.TestGenerationUtils.getComponentsUtils;
-
@RunWith(MockitoJUnitRunner.class)
public class PolicyTargetsUpdateOperationTest {
package org.openecomp.sdc.be.components.impl.version;
+import static java.util.Arrays.asList;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Resource;
-import static java.util.Arrays.asList;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-
@RunWith(MockitoJUnitRunner.class)
public class PostChangeVersionOperationOrchestratorTest {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.user.Role;
import org.openecomp.sdc.exception.ResponseFormat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class CertificationChangeTransitionTest extends LifecycleTestBase {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.http.HttpStatus;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.user.Role;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.Silent.class)
public class CertificationRequestTest extends LifecycleTestBase {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.user.Role;
import org.openecomp.sdc.exception.ResponseFormat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class CheckinTest extends LifecycleTestBase {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.user.Role;
import org.openecomp.sdc.exception.ResponseFormat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class CheckoutTest extends LifecycleTestBase {
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
import org.junit.BeforeClass;
import org.mockito.InjectMocks;
import org.mockito.Mockito;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class LifecycleTestBase {
private static final Logger log = LoggerFactory.getLogger(LifecycleTestBase.class);
package org.openecomp.sdc.be.components.lifecycle;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.user.Role;
import org.openecomp.sdc.exception.ResponseFormat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class UndoCheckoutTest extends LifecycleTestBase {
package org.openecomp.sdc.be.components.merge;
-import com.google.common.collect.Sets;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
+import com.google.common.collect.Sets;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class GlobalInputsFilteringBusinessLogicTest {
package org.openecomp.sdc.be.components.merge;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.be.components.utils.ObjectGenerator.buildResourceWithInputs;
+
+import java.util.Arrays;
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.InputDefinition;
import org.openecomp.sdc.be.model.Resource;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-import static org.openecomp.sdc.be.components.utils.ObjectGenerator.buildResourceWithInputs;
+import fj.data.Either;
public class GlobalTypesMergeBusinessLogicTest {
package org.openecomp.sdc.be.components.merge;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.components.utils.ComponentInstanceBuilder;
import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
import org.openecomp.sdc.be.model.Resource;
-import java.util.Arrays;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
public class RelationsComparatorTest {
public static final String INSTANCE1 = "instance1";
package org.openecomp.sdc.be.components.merge;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class TopologyComparatorTest {
package org.openecomp.sdc.be.components.merge.capability;
-import com.google.common.collect.ImmutableMap;
+import static java.util.Arrays.asList;
+import static java.util.Collections.emptyMap;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.when;
+
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Resource;
-import java.util.Map;
-
-import static java.util.Arrays.asList;
-import static java.util.Collections.emptyMap;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.when;
+import com.google.common.collect.ImmutableMap;
@RunWith(MockitoJUnitRunner.class)
public class SimpleCapabilityResolverTest {
package org.openecomp.sdc.be.components.merge.heat;
+import static org.junit.Assert.assertEquals;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.components.utils.ArtifactBuilder;
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.HeatParameterDefinition;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Stream;
-
-import static org.junit.Assert.assertEquals;
-
public class HeatEnvArtifactsMergeBusinessLogicTest {
private HeatEnvArtifactsMergeBusinessLogic testInstance;
package org.openecomp.sdc.be.components.merge.input;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.ListUtils;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ComponentInputsMergeBLTest {
package org.openecomp.sdc.be.components.merge.input;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
import org.openecomp.sdc.be.model.InputDefinition;
import org.openecomp.sdc.be.model.Resource;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
public class InputsValuesMergingBusinessLogicTest {
public static final String INPUT_DEFUALT_TYPE = "string";
package org.openecomp.sdc.be.components.merge.instance;
+import static junit.framework.TestCase.assertEquals;
+
+import java.util.HashMap;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Resource;
-import java.util.HashMap;
-import java.util.Map;
-
-import static groovy.util.GroovyTestCase.assertEquals;
-
public class ComponentInstanceArtifactsMergeTest {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.util.Collections;
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Collections;
-import java.util.List;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class ComponentInstanceCapabiliteisPropertiesMergeTest {
package org.openecomp.sdc.be.components.merge.instance;
-import com.google.common.collect.ImmutableMap;
-import fj.data.Either;
+import static java.util.Collections.emptyMap;
+import static java.util.Collections.singletonList;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyList;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import com.google.common.collect.ImmutableMap;
-import static java.util.Collections.emptyMap;
-import static java.util.Collections.singletonList;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.anyList;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class ComponentInstanceCapabilitiesMergeBLTest {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import static org.mockito.Mockito.when;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
import org.openecomp.sdc.common.api.ArtifactTypeEnum;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ComponentInstanceHeatEnvMergeTest {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Arrays;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ComponentInstanceMergeDataBusinessLogicTest {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyList;
+import static org.mockito.ArgumentMatchers.anyListOf;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.mockito.ArgumentMatchers.anyList;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyListOf;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ComponentInstancePropsAndInputsMergeTest {
package org.openecomp.sdc.be.components.merge.instance;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.IntStream;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.IntStream;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class ComponentInstanceRelationMergeTest {
package org.openecomp.sdc.be.components.merge.path;
-import fj.data.Either;
+import static groovy.util.GroovyTestCase.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.TestCase.assertEquals;
+import static junit.framework.TestCase.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.Mockito.when;
+
+import java.util.Set;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.common.api.UserRoleEnum;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Set;
-
-import static groovy.util.GroovyTestCase.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.TestCase.assertTrue;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ComponentInstanceForwardingPathMergeTest extends BaseForwardingPathVersionChangeTest {
package org.openecomp.sdc.be.components.merge.property;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Collections;
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.Collections;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ComponentInstanceInputsMergeBLTest {
package org.openecomp.sdc.be.components.merge.property;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Collections;
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.Collections;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ComponentInstancePropertiesMergeBLTest {
package org.openecomp.sdc.be.components.merge.property;
+import static org.mockito.Mockito.verify;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.openecomp.sdc.be.model.InputDefinition;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import static org.mockito.Mockito.verify;
-
public class DataDefinitionsValuesMergingBusinessLogicTest {
private static final String DEFAULT_PROP_TYPE = "string";
package org.openecomp.sdc.be.components.merge.property;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache;
import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class PropertyDataValueMergeBusinessLogicTest {
package org.openecomp.sdc.be.components.merge.resource;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.model.Resource;
-import java.util.Arrays;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-
@RunWith(MockitoJUnitRunner.class)
public class ResourceDataMergeBusinessLogicTest {
package org.openecomp.sdc.be.components.merge.utils;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class MergeInstanceUtilsTest {
package org.openecomp.sdc.be.components.path;
-import com.google.common.collect.Lists;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
import org.junit.Before;
import org.openecomp.sdc.be.components.BeConfDependentTest;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
+import com.google.common.collect.Lists;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class BaseForwardingPathTest extends BeConfDependentTest implements ForwardingPathTestUtils {
package org.openecomp.sdc.be.components.path;
-import com.google.common.collect.Lists;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.openecomp.sdc.be.components.merge.instance.DataForMergeHolder;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.google.common.collect.Lists;
public abstract class BaseForwardingPathVersionChangeTest {
protected Service service;
package org.openecomp.sdc.be.components.path;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/paths/path-context.xml")
package org.openecomp.sdc.be.components.path;
-import org.javatuples.Pair;
-import org.junit.Test;
-import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
-import org.openecomp.sdc.be.impl.ForwardingPathUtils;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import org.javatuples.Pair;
+import org.junit.Test;
+import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
+import org.openecomp.sdc.be.impl.ForwardingPathUtils;
public class ForwardingPathChangeVersionTest extends BaseForwardingPathVersionChangeTest {
package org.openecomp.sdc.be.components.path;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.impl.ForwardingPathUtils;
import org.openecomp.sdc.be.model.Service;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
public class ForwardingPathDeleteCITest {
private Service service;
package org.openecomp.sdc.be.components.path;
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.FORWARDER;
+import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.FORWARDS_TO_TOSCA_NAME;
+import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.PORTS_RANGE;
+import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.PROTOCOL;
+import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.addForwardingPaths;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.FORWARDER;
-import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.FORWARDS_TO_TOSCA_NAME;
-import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.PORTS_RANGE;
-import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.PROTOCOL;
-import static org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil.addForwardingPaths;
-
/**
* @author KATYR, ORENK
* @since November 19, 2017
package org.openecomp.sdc.be.components.path;
-import com.google.common.collect.Sets;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+import java.util.Collection;
+import java.util.Set;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Collection;
-import java.util.Set;
+import com.google.common.collect.Sets;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ForwardingPathValidatorTest implements ForwardingPathTestUtils {
package org.openecomp.sdc.be.components.path.beans;
+import javax.annotation.PostConstruct;
+
import org.openecomp.sdc.be.dao.cassandra.ArtifactCassandraDao;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-
@Component("artifact-cassandra-dao")
public class ArtifactCassandraDaoMock extends ArtifactCassandraDao {
@PostConstruct
package org.openecomp.sdc.be.components.path.beans;
+import javax.annotation.PostConstruct;
+
import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-
@Component("audit-cassandra-dao")
public class AuditCassandraDaoMock extends AuditCassandraDao{
package org.openecomp.sdc.be.components.path.beans;
-import com.datastax.driver.core.Session;
-import com.datastax.driver.mapping.MappingManager;
-import fj.data.Either;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.dao.cassandra.CassandraClient;
import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
import org.springframework.stereotype.Component;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.mapping.MappingManager;
+
+import fj.data.Either;
+
@Component("cassandra-client")
public class CassandraClientMock extends CassandraClient{
public CassandraClientMock() {
package org.openecomp.sdc.be.components.path.beans;
-import fj.data.Either;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.annotation.PostConstruct;
+
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
import org.openecomp.sdc.be.resources.data.ComponentCacheData;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import fj.data.Either;
@Component("component-cassandra-dao")
public class ComponentCassandraDaoMock extends ComponentCassandraDao {
package org.openecomp.sdc.be.components.path.beans;
+import javax.annotation.PostConstruct;
+
import org.openecomp.sdc.be.dao.cassandra.OperationalEnvironmentDao;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-
@Component("operational-environment-dao")
public class EnvironmentCassandraDaoMock extends OperationalEnvironmentDao {
@PostConstruct
package org.openecomp.sdc.be.components.path.beans;
-import fj.data.Either;
import org.openecomp.sdc.be.impl.ForwardingPathUtils;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
+import fj.data.Either;
+
@org.springframework.stereotype.Component("tosca-operation-facade")
public class ForwardingPathToscaOperationFacade extends ToscaOperationFacade {
protected static final String GENERIC_SERVICE_NAME = "org.openecomp.resource.abstract.nodes.service";
package org.openecomp.sdc.be.components.path.beans;
-import fj.data.Either;
+import java.util.Collection;
+
import org.openecomp.sdc.be.components.path.ForwardingPathValidator;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Collection;
+import fj.data.Either;
public class ForwardingPathValidatorMock extends ForwardingPathValidator {
@Override
package org.openecomp.sdc.be.components.path.beans;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.annotation.PostConstruct;
+
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.openecomp.sdc.be.dao.TitanClientStrategy;
+import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
+import org.openecomp.sdc.be.dao.titan.TitanGraphClient;
+import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
import com.thinkaurelius.titan.core.InvalidElementException;
import com.thinkaurelius.titan.core.InvalidIDException;
import com.thinkaurelius.titan.core.PropertyKey;
import com.thinkaurelius.titan.diskstorage.ResourceUnavailableException;
import com.thinkaurelius.titan.diskstorage.locking.PermanentLockingException;
import com.thinkaurelius.titan.graphdb.database.idassigner.IDPoolExhaustedException;
-import fj.data.Either;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.openecomp.sdc.be.dao.TitanClientStrategy;
-import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
-import org.openecomp.sdc.be.dao.titan.TitanGraphClient;
-import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import java.util.ArrayList;
-import java.util.HashMap;
+import fj.data.Either;
@Component("titan-client")
public class InMemoryTitanGraphClient extends TitanGraphClient {
package org.openecomp.sdc.be.components.path.beans;
+import javax.annotation.PostConstruct;
+
import org.openecomp.sdc.be.dao.cassandra.SdcSchemaFilesCassandraDao;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-
@Component("sdc-schema-files-cassandra-dao")
public class SdcSchemaFilesCassandraDaoMock extends SdcSchemaFilesCassandraDao {
package org.openecomp.sdc.be.components.path.beans;
-import com.thinkaurelius.titan.core.PropertyKey;
-import com.thinkaurelius.titan.core.TitanGraph;
-import com.thinkaurelius.titan.core.TitanGraphQuery;
-import com.thinkaurelius.titan.core.schema.ConsistencyModifier;
-import com.thinkaurelius.titan.core.schema.TitanGraphIndex;
-import com.thinkaurelius.titan.core.schema.TitanManagement;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.openecomp.sdc.be.dao.graph.datatype.ActionEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
+import com.thinkaurelius.titan.core.PropertyKey;
+import com.thinkaurelius.titan.core.TitanGraph;
+import com.thinkaurelius.titan.core.TitanGraphQuery;
+import com.thinkaurelius.titan.core.schema.ConsistencyModifier;
+import com.thinkaurelius.titan.core.schema.TitanGraphIndex;
+import com.thinkaurelius.titan.core.schema.TitanManagement;
public class TitanGraphTestSetup {
package org.openecomp.sdc.be.components.path.utils;
-import com.thinkaurelius.titan.core.TitanGraph;
-import com.thinkaurelius.titan.core.TitanVertex;
-import fj.data.Either;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.UUID;
+
import org.apache.tinkerpop.gremlin.structure.io.IoCore;
import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.UUID;
+import com.thinkaurelius.titan.core.TitanGraph;
+import com.thinkaurelius.titan.core.TitanVertex;
+
+import fj.data.Either;
public final class GraphTestUtils {
package org.openecomp.sdc.be.components.property;
-import fj.data.Either;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
package org.openecomp.sdc.be.components.property;
-import fj.data.Either;
+import static org.assertj.core.api.Java6Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.assertj.core.api.Java6Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
package org.openecomp.sdc.be.components.property;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.openecomp.sdc.common.api.Constants.GET_INPUT;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
import org.junit.Before;
import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
import org.openecomp.sdc.be.dao.utils.MapUtil;
import org.openecomp.sdc.be.model.ComponentInstanceProperty;
import org.openecomp.sdc.be.model.InputDefinition;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.openecomp.sdc.common.api.Constants.GET_INPUT;
-
public class PropertyDeceleratorTestBase {
static final String INNER_PROP1 = "ecomp_generated_naming";
package org.openecomp.sdc.be.components.scheduledtasks;
-import fj.data.Either;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
import org.apache.commons.lang.math.NumberUtils;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
import org.openecomp.sdc.common.datastructure.Wrapper;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class RecoveryThreadManagerTest extends BeConfDependentTest {
package org.openecomp.sdc.be.components.utils;
+import java.util.ArrayList;
+
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.HeatParameterDefinition;
-import java.util.ArrayList;
-
public class ArtifactBuilder {
private ArtifactDefinition artifactDefinition;
package org.openecomp.sdc.be.components.utils;
+import java.util.ArrayList;
+
import org.openecomp.sdc.be.model.CapabilityDefinition;
import org.openecomp.sdc.be.model.ComponentInstanceProperty;
-import java.util.ArrayList;
-
public class CapabilityDefinitionBuilder {
private CapabilityDefinition capabilityDefinition;
package org.openecomp.sdc.be.components.utils;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
import org.openecomp.sdc.be.dao.utils.MapUtil;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.PolicyDefinition;
import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
public abstract class ComponentBuilder<T extends Component, B extends ComponentBuilder<T, B>> {
private T component;
package org.openecomp.sdc.be.components.utils;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.CapabilityDefinition;
-import org.openecomp.sdc.be.model.ComponentInstance;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.stream.Stream;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+
public class ComponentInstanceBuilder {
private ComponentInstance componentInstance;
package org.openecomp.sdc.be.components.utils;
-import org.openecomp.sdc.be.model.GroupDefinition;
-
import java.util.HashMap;
import java.util.Map;
+import org.openecomp.sdc.be.model.GroupDefinition;
+
public class GroupDefinitionBuilder {
private GroupDefinition groupDefinition;
package org.openecomp.sdc.be.components.utils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.ComponentInstanceInput;
import org.openecomp.sdc.be.model.ComponentInstanceProperty;
import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
import org.openecomp.sdc.be.model.Resource;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
public class ObjectGenerator {
public static Resource buildResourceWithInputs(String ... inputNames) {
package org.openecomp.sdc.be.components.utils;
+import java.util.Set;
+
import org.openecomp.sdc.be.datatypes.enums.EnvironmentStatusEnum;
import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
-import java.util.Set;
-
public class OperationalEnvironmentBuilder {
private OperationalEnvironmentEntry operationalEnvironmentEntry;
package org.openecomp.sdc.be.components.utils;
-import org.openecomp.sdc.be.datatypes.elements.PolicyTargetType;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-import org.openecomp.sdc.be.model.PolicyDefinition;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.openecomp.sdc.be.datatypes.elements.PolicyTargetType;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.model.PolicyDefinition;
+
public class PolicyDefinitionBuilder {
private PolicyDefinition policyDefinition;
package org.openecomp.sdc.be.components.utils;
-import org.openecomp.sdc.be.model.PolicyTypeDefinition;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-
import java.util.List;
import java.util.Map;
+import org.openecomp.sdc.be.model.PolicyTypeDefinition;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+
public class PolicyTypeBuilder {
private PolicyTypeDefinition policyTypeDataDefinition;
package org.openecomp.sdc.be.components.utils;
+import java.util.ArrayList;
+
import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
-import java.util.ArrayList;
-
public abstract class PropertyDataDefinitionAbstractBuilder<B extends PropertyDataDefinition, T extends PropertyDataDefinitionAbstractBuilder<B, T>> {
B propertyDefinition;
package org.openecomp.sdc.be.components.utils;
+import java.util.List;
+
import org.openecomp.sdc.be.model.PropertyConstraint;
import org.openecomp.sdc.be.model.PropertyDefinition;
-import java.util.List;
-
public class PropertyDataDefinitionBuilder extends PropertyDataDefinitionAbstractBuilder<PropertyDefinition, PropertyDataDefinitionBuilder> {
protected PropertyDataDefinitionBuilder self() {
package org.openecomp.sdc.be.components.utils;
+import java.util.Collections;
+
import org.openecomp.sdc.be.model.CapabilityRequirementRelationship;
import org.openecomp.sdc.be.model.RelationshipImpl;
import org.openecomp.sdc.be.model.RelationshipInfo;
import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
-import java.util.Collections;
-
public class RelationsBuilder {
private RequirementCapabilityRelDef relation;
package org.openecomp.sdc.be.components.utils;
+import java.util.ArrayList;
+
import org.openecomp.sdc.be.model.PropertyDefinition;
import org.openecomp.sdc.be.model.Resource;
-import java.util.ArrayList;
-
public class ResourceBuilder extends ComponentBuilder<Resource, ResourceBuilder> {
private Resource resource;
package org.openecomp.sdc.be.components.utils;
-import org.junit.Test;
+import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import static org.assertj.core.api.Assertions.assertThat;
+import org.junit.Test;
public class UtilsTest {
package org.openecomp.sdc.be.components.validation;
-import com.google.common.collect.Sets;
-import fj.data.Either;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+import com.google.common.collect.Sets;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class InterfaceOperationValidationTest implements InterfaceOperationTestUtils {
package org.openecomp.sdc.be.components.validation;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
import org.openecomp.sdc.exception.ResponseFormat;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ServiceDistributionValidationTest {
package org.openecomp.sdc.be.datamodel;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Collections;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.components.utils.PolicyDefinitionBuilder;
import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer;
-import java.util.Collections;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
public class UiComponentDataConverterTest {
private PolicyDefinition policy1, policy2;
package org.openecomp.sdc.be.distribution;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.openecomp.sdc.be.components.distribution.engine.DistributionEngineInitTask.buildTopicName;
+
+import javax.ws.rs.core.Response;
+
import org.apache.http.HttpStatus;
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.distribution.api.client.TopicUnregistrationResponse;
import org.openecomp.sdc.common.datastructure.Wrapper;
-import javax.ws.rs.core.Response;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import static org.openecomp.sdc.be.components.distribution.engine.DistributionEngineInitTask.buildTopicName;
-
public class DistributionBusinessLogicTest extends BeConfDependentTest {
@InjectMocks
package org.openecomp.sdc.be.distribution;
+import static org.junit.Assert.assertTrue;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.sdc.be.components.BeConfDependentTest;
import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
import org.openecomp.sdc.common.api.ArtifactTypeEnum;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.junit.Assert.assertTrue;
-
public class ServiceDistributionArtifactsBuilderTest extends BeConfDependentTest {
@InjectMocks
package org.openecomp.sdc.be.distribution;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler;
-import org.openecomp.sdc.be.components.distribution.engine.INotificationData;
-import org.openecomp.sdc.be.components.distribution.engine.NotificationDataImpl;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler;
+import org.openecomp.sdc.be.components.distribution.engine.INotificationData;
+import org.openecomp.sdc.be.components.distribution.engine.NotificationDataImpl;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+
public class TestQueue {
public static void main(String[] args) {
package org.openecomp.sdc.be.distribution.servlet;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.http.HttpStatus;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
public class DistributionServletTest extends JerseyTest {
package org.openecomp.sdc.be.ecomp;
-import org.junit.Test;
-import org.openecomp.sdc.common.config.EcompClassification;
-import org.openecomp.sdc.common.config.EcompErrorCode;
-import org.openecomp.sdc.common.config.EcompErrorEnum;
-import org.openecomp.sdc.common.config.generation.GenerateEcompErrorsCsv;
+import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.openecomp.sdc.common.config.EcompClassification;
+import org.openecomp.sdc.common.config.EcompErrorCode;
+import org.openecomp.sdc.common.config.EcompErrorEnum;
+import org.openecomp.sdc.common.config.generation.GenerateEcompErrorsCsv;
public class GenerateEcompErrorFileTest {
package org.openecomp.sdc.be.externalapi.servlet;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.http.HttpStatus;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.Arrays;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class AssetsDataServletTest extends JerseyTest {
package org.openecomp.sdc.be.impl;
-import java.util.EnumMap;
import java.util.List;
-import javax.annotation.Generated;
-import javax.servlet.http.HttpServletRequest;
-
import org.apache.tinkerpop.gremlin.structure.T;
-import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
import org.openecomp.sdc.be.auditing.impl.AuditingManager;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.model.CapabilityTypeDefinition;
import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.ConsumerDefinition;
import org.openecomp.sdc.be.model.DataTypeDefinition;
import org.openecomp.sdc.be.model.GroupTypeDefinition;
import org.openecomp.sdc.be.model.PolicyTypeDefinition;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
import org.openecomp.sdc.be.resources.data.auditing.model.ResourceAuditData;
import org.openecomp.sdc.be.tosca.ToscaError;
import org.openecomp.sdc.common.api.ConfigurationSource;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.openecomp.sdc.exception.ResponseFormat;
import fj.data.Either;
-import mockit.Deencapsulation;
public class ComponentsUtilsTest {
package org.openecomp.sdc.be.servlets;
-import fj.data.Either;
-import org.apache.commons.codec.binary.Base64;
-import org.junit.Before;
-import org.junit.Test;
-import org.openecomp.sdc.be.model.UploadResourceInfo;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.common.datastructure.Wrapper;
-import org.openecomp.sdc.exception.ResponseFormat;
-import org.slf4j.Logger;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
-import javax.ws.rs.core.Response;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.stream.Stream;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
+import javax.ws.rs.core.Response;
+
+import org.apache.commons.codec.binary.Base64;
+import org.junit.Before;
+import org.junit.Test;
+import org.openecomp.sdc.be.model.UploadResourceInfo;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.common.datastructure.Wrapper;
+import org.openecomp.sdc.exception.ResponseFormat;
+import org.slf4j.Logger;
+
+import fj.data.Either;
public class AbstractValidationsServletTest {
private static AbstractValidationsServlet servlet = new AbstractValidationsServlet() {};
package org.openecomp.sdc.be.servlets;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.Application;
+
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.MultiPart;
import org.glassfish.jersey.server.ResourceConfig;
import org.mockito.Mockito;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.core.Application;
-import java.util.HashSet;
-import java.util.Set;
-
public class ApplicationConfig extends Application {
public Set<Class<?>> getClasses() {
package org.openecomp.sdc.be.servlets;
+import static org.mockito.Mockito.mock;
+
import org.openecomp.sdc.be.auditing.impl.AuditingManager;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.springframework.context.annotation.Bean;
-import static org.mockito.Mockito.mock;
-
public class BaseTestConfig {
@Bean
package org.openecomp.sdc.be.servlets;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.eclipse.jetty.http.HttpStatus;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
/**
* The test suite designed for test functionality of ComponentInstanceServlet class
package org.openecomp.sdc.be.servlets;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
-import fj.data.Either;
+import static java.util.Arrays.asList;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Stream;
+
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider;
import org.springframework.context.annotation.Import;
import org.springframework.http.HttpStatus;
-import javax.ws.rs.client.Invocation;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Stream;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
-import static java.util.Arrays.asList;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class GroupTypesEndpointTest extends JerseySpringBaseTest {
package org.openecomp.sdc.be.servlets;
+import static org.mockito.Mockito.mock;
+
+import javax.servlet.http.HttpServletRequest;
+
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import javax.servlet.http.HttpServletRequest;
-
-import static org.mockito.Mockito.mock;
-
public class JerseySpringBaseTest extends JerseyTest {
protected static HttpServletRequest request;
package org.openecomp.sdc.be.servlets;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import fj.data.Either;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyMap;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.glassfish.grizzly.http.util.HttpStatus;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.exception.ResponseFormat;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import com.fasterxml.jackson.databind.DeserializationFeature;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyMap;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class PolicyServletTest extends JerseySpringBaseTest{
package org.openecomp.sdc.be.servlets;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import fj.data.Either;
+import static java.util.Arrays.asList;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.http.HttpStatus;
import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.exception.ResponseFormat;
-import javax.ws.rs.client.Invocation;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.List;
+import com.fasterxml.jackson.databind.DeserializationFeature;
-import static java.util.Arrays.asList;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class PolicyTypesEndpointTest extends JerseySpringBaseTest {
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
+
import org.apache.tinkerpop.gremlin.structure.T;
import org.junit.Test;
import org.openecomp.sdc.be.model.ArtifactDefinition;
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.springframework.http.HttpStatus;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.Arrays;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class ResourceServletTest extends JerseyTest {
public static final HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
+import static org.mockito.ArgumentMatchers.anyObject;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
+import com.google.gson.Gson;
public class ResourceUploadServletTest extends JerseyTest {
private static final Logger log = LoggerFactory.getLogger(ResourceUploadServletTest.class);
package org.openecomp.sdc.be.servlets;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.eclipse.jetty.http.HttpStatus;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.client.ClientConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class TypesUploadServletTest extends JerseyTest {
package org.openecomp.sdc.be.servlets;
-import com.google.gson.Gson;
-import fj.data.Either;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.ws.rs.core.Application;
+
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.springframework.http.HttpStatus;
import org.springframework.web.context.WebApplicationContext;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.core.Application;
+import com.google.gson.Gson;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class UserAdminServletTest extends JerseyTest {
package org.openecomp.sdc.be.tosca;
//
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.CapabilityDefinition;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
+import static java.util.Arrays.asList;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.doReturn;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
-import static java.util.Arrays.asList;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.doReturn;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
public class CapabiltyRequirementConvertorTest {
package org.openecomp.sdc.be.tosca;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class CsarUtilsTest {
@Before
package org.openecomp.sdc.be.tosca;
-import fj.data.Either;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
import org.openecomp.sdc.be.tosca.model.ToscaNodeType;
import org.openecomp.sdc.be.tosca.model.ToscaProperty;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import fj.data.Either;
public class PropertyConvertorTest {
private PropertyDefinition property;
package org.openecomp.sdc.be.tosca;
-import org.junit.Test;
-import org.yaml.snakeyaml.Yaml;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.yaml.snakeyaml.Yaml;
public class SchemaFiles {
package org.openecomp.sdc.be.tosca;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
import org.junit.Test;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.model.operations.impl.ComponentInstanceOperation;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
public class ToscaExportUtilsTest {
private static final Logger log = LoggerFactory.getLogger(ToscaExportUtilsTest.class);
@javax.annotation.Resource
import java.util.HashMap;
import java.util.Map;
+
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.util.HashMap;
+
import org.junit.BeforeClass;
import org.junit.Test;
import org.openecomp.sdc.be.DummyConfigurationManager;
package org.openecomp.sdc.common.transaction.mngr;
-import fj.data.Either;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openecomp.sdc.common.transaction.api.TransactionUtils.TransactionStatusEnum;
import org.slf4j.Logger;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import fj.data.Either;
public class SdncTransactionTest {
private static ESCatalogDAO esCatalogDao = Mockito.mock(ESCatalogDAO.class);
package org.openecomp.sdc.cucumber.runners;
-import cucumber.api.CucumberOptions;
-import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
import org.openecomp.sdc.be.components.BeConfDependentTest;
+import cucumber.api.CucumberOptions;
+import cucumber.api.junit.Cucumber;
+
@RunWith(Cucumber.class)
@CucumberOptions(features = "classpath:cucumber/tenantIsolation.feature", glue = "org.openecomp.sdc.be.components.distribution.engine")
import java.util.Map;
-import javax.annotation.Generated;
-
import org.junit.Test;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
-@Generated(value = "org.junit-tools-1.0.6")
public class ServiceTest {
private Service createTestSubject() {
return new Service();
}
-
@Test
public void testGetServiceApiArtifacts() throws Exception {