Raise JUnit coverage common-be 29/47329/2
authorTal Gitelman <tg851x@intl.att.com>
Sun, 13 May 2018 19:29:24 +0000 (22:29 +0300)
committerTal Gitelman <tg851x@intl.att.com>
Sun, 13 May 2018 20:48:31 +0000 (20:48 +0000)
Change-Id: If7b31082105378901e9a09e26a8cc1b5737eb425
Issue-ID: SDC-1298
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
404 files changed:
catalog-be/src/main/java/org/openecomp/sdc/be/auditing/api/AuditEventFactory.java
catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditBaseEventFactory.java
catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatUtil.java
catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarArtifactsAndGroupsBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/AaiRequestHandler.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/ArtifactInfoImpl.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaErrorResponse.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DME2EndpointIteratorCreator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealth.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineInitTask.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEnginePollingTask.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapClientFactory.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapConsumer.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentMessageBusData.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/ExecutorFactory.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/JsonContainerResourceInstance.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/NotificationExecutorService.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/ServiceDistributionArtifactsBuilder.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/UebHealthCheckCall.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayload.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/report/MsoDistributionCompleteReporter.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/rest/MSORestClient.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/AdditionalInformationBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactResolverImpl.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CapabilityTypeImportManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CategoriesImportManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ConsumerBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/DataTypeImportManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/DistributionMonitoringBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ExternalRefsBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupTypeBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupTypeImportManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ImportUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceLifecycleTypeImportManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/MonitoringBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PolicyTypeBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PolicyTypeImportManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ProductBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PropertyBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/utils/PolicyTypeImportUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/version/GroupMembersUpdateOperation.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/version/PolicyTargetsUpdateOperation.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/version/PostChangeVersionOperationOrchestrator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransition.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTransition.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CheckinTransition.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTransition.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifeCycleTransition.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/RelationsComparator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/TopologyComparator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/capability/CapabilityResolver.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/capability/SimpleCapabilityResolver.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBL.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentCapabilitiesPropertiesMergeBL.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMerge.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabiliteisPropertiesMerge.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceForwardingPathMerge.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMerge.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceInputsMergeBL.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeInterface.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropertiesMergeBL.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMerge.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/DataForMergeHolder.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/MergePropertyData.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyValueMerger.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ScalarPropertyValueMerger.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBLFactory.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/utils/MergeInstanceUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/path/ForwardingPathValidator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/property/ComponentInstanceInputPropertyDecelerator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/property/ComponentInstancePropertyDecelerator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDecelerator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/property/PolicyPropertyDecelerator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/property/PropertyDecelerationOrchestrator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/property/PropertyDecelerator.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/scheduledtasks/AbstractScheduleTaskRunner.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/scheduledtasks/AsdcComponentsCleanerTask.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/scheduledtasks/ComponentsCleanBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/scheduledtasks/RecoveryThreadManager.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/Utils.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/InterfaceOperationValidation.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/PolicyUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ServiceDistributionValidation.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/UserValidations.java
catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/ArtifactUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/InterfaceUIDataConverter.java
catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java
catalog-be/src/main/java/org/openecomp/sdc/be/distribution/DistributionBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionCatalogServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/EcompIntImpl.java
catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/AssetMetadataConverter.java
catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverter.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/CrudExternalServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ServiceActivationServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/filters/BasicAuthenticationFilter.java
catalog-be/src/main/java/org/openecomp/sdc/be/filters/BeServletFilter.java
catalog-be/src/main/java/org/openecomp/sdc/be/filters/ComponentsAvailabilityFilter.java
catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/impl/DownloadArtifactLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/impl/ForwardingPathUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/impl/ServletUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/impl/WebAppContextWrapper.java
catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactTemplateInfo.java
catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactTypesInfo.java
catalog-be/src/main/java/org/openecomp/sdc/be/info/GroupDefinitionInfo.java
catalog-be/src/main/java/org/openecomp/sdc/be/info/MergedArtifactInfo.java
catalog-be/src/main/java/org/openecomp/sdc/be/info/NodeTypeInfoToUpdateArtifacts.java
catalog-be/src/main/java/org/openecomp/sdc/be/info/OperationalEnvInfo.java
catalog-be/src/main/java/org/openecomp/sdc/be/info/Relationship.java
catalog-be/src/main/java/org/openecomp/sdc/be/mixin/GroupTypeMixin.java
catalog-be/src/main/java/org/openecomp/sdc/be/mixin/PolicyTypeMixin.java
catalog-be/src/main/java/org/openecomp/sdc/be/monitoring/EsGateway.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentExceptionMapper.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigMgrServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/CsarBuildServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DefaultExceptionMapper.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupTypesEndpoint.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpoint.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PropertyServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RepresentationUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementsServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceArtifactDownloadServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceInterfaceOperationServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceForwardingPathServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/StorageExceptionMapper.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ToscaDaoServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java
catalog-be/src/main/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetector.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ArtifactTypes.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaRepresentation.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaTemplate.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/OperationArtifactUtil.java
catalog-be/src/main/java/org/openecomp/sdc/be/user/IUserBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/user/UserBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/view/MixinModelWriter.java
catalog-be/src/main/java/org/openecomp/sdc/common/transaction/api/ITransactionSdnc.java
catalog-be/src/main/java/org/openecomp/sdc/common/transaction/api/RollbackHandler.java
catalog-be/src/main/java/org/openecomp/sdc/common/transaction/impl/ESRollbackHandler.java
catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/CommitManager.java
catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/TransactionManager.java
catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/TransactionSdncImpl.java
catalog-be/src/test/java/org/openecomp/sdc/ElementOperationMock.java
catalog-be/src/test/java/org/openecomp/sdc/ErrorConfigurationTest.java
catalog-be/src/test/java/org/openecomp/sdc/TestExternalConfiguration.java
catalog-be/src/test/java/org/openecomp/sdc/ZipUtil.java
catalog-be/src/test/java/org/openecomp/sdc/be/DummyConfigurationManager.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditAuthRequestEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditBaseEventFactoryTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFuncTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditEcompOpEnvEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditResourceEventFactoryManangerTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatUtilTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/category/AuditCategoryEventFuncTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/category/AuditGetCategoryHierarchyEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditCreateTopicDistribEngineEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistrEngineFuncTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistrEventFuncTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribDeployEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribDownloadEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribNotificationEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribStatusEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditGetUebClusterEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/ecompopenv/AuditEcompOpEnvEventTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditActivateServiceExternalApiEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditChangeLifecycleExternalApiEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditCreateResourceExternalApiEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditDownloadArtifactExternalApiEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditExternalApiEventFuncTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditArtifactResourceAdminEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditCertificationResourceAdminEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditCreateUpdateResourceAdminEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditDistStateChangeRequestResourceAdminEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditDistStateChangeResourceAdminEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditImportResourceAdminEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditResourceAdminEventFuncTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditGetUsersListEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditUserAccessEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditUserAdminEventFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditUserEventFuncTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/AuditingManagerTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/BaseServiceBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/ComponentBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/GroupBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/InterfaceOperationTestUtils.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/PathTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceTestUtils.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/ServiceBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/ServiceDistributionBLTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/AaiMockRequestHandlerTest.java [deleted file]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/AaiRequestHandlerTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/ArtifactInfoImplTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/CambriaErrorResponseTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandlerTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/Dev2DevDmaapConsumerTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealthTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineConfigTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineHealthCheckTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineInitTaskTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEnginePollingTaskTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionStatusNotificationTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapClientFactoryTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapConsumerTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealthTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapNotificationDataImplTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentMessageBusDataTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngineMockTest.java [new file with mode: 0644]
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/ServiceDistributionArtifactsBuilderTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/StepsTenantIsolation.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/rest/MsoRestClientTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AdditionalInformationBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactResolverTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CapabilityTypeImportManagerTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentsUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CsarValidationUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBLTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ImportUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceLifecycleTypeImportManagerTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/PolicyBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/PolicyPropertiesBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/PolicyTypeBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceInstanceBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/PolicyTypeImportUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/version/GroupMembersUpdateOperationTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/version/PolicyTargetsUpdateOperationTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/version/PostChangeVersionOperationOrchestratorTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransitionTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckinTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/LifecycleTestBase.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/RelationsComparatorTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/TopologyComparatorTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/capability/SimpleCapabilityResolverTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBLTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMergeTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabiliteisPropertiesMergeTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabilitiesMergeBLTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMergeTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMergeTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceRelationMergeTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/path/ComponentInstanceForwardingPathMergeTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBLTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBLTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/utils/MergeInstanceUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathVersionChangeTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathBussinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathChangeVersionTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathDeleteCITest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathToscaUtilTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathValidatorTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/ArtifactCassandraDaoMock.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/AuditCassandraDaoMock.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/CassandraClientMock.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/ComponentCassandraDaoMock.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/EnvironmentCassandraDaoMock.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/ForwardingPathToscaOperationFacade.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/ForwardingPathValidatorMock.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/InMemoryTitanGraphClient.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/SdcSchemaFilesCassandraDaoMock.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/beans/TitanGraphTestSetup.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/path/utils/GraphTestUtils.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/property/ComponentInstancePropertyDeceleratorTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/property/PolicyPropertyDeceleratorTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/property/PropertyDeceleratorTestBase.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/scheduledtasks/RecoveryThreadManagerTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ArtifactBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/CapabilityDefinitionBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ComponentBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ComponentInstanceBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/GroupDefinitionBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ObjectGenerator.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/OperationalEnvironmentBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/PolicyDefinitionBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/PolicyTypeBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/PropertyDataDefinitionAbstractBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/PropertyDataDefinitionBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/RelationsBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ResourceBuilder.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/UtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/InterfaceOperationValidationTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/ServiceDistributionValidationTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/UiComponentDataConverterTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/distribution/DistributionBusinessLogicTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/distribution/ServiceDistributionArtifactsBuilderTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java
catalog-be/src/test/java/org/openecomp/sdc/be/distribution/servlet/DistributionServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/GenerateEcompErrorFileTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/impl/ComponentsUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ApplicationConfig.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/BaseTestConfig.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupTypesEndpointTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/JerseySpringBaseTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpointTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RepresentationUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserAdminServletTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertorTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/tosca/SchemaFiles.java
catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportUtilsTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/OperationArtifactUtilTest.java
catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/SdncTransactionTest.java
catalog-be/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationTest.java
catalog-be/src/test/resources/config/mock.txt [new file with mode: 0644]
catalog-model/src/test/java/org/openecomp/sdc/be/model/ServiceTest.java

index eed347f..1ea8ff9 100644 (file)
@@ -1,10 +1,10 @@
 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();
index 8636c1b..2ccc791 100644 (file)
@@ -1,5 +1,8 @@
 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;
@@ -7,9 +10,6 @@ import org.openecomp.sdc.be.model.User;
 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.
index ee4b70c..92baba2 100644 (file)
 
 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;
@@ -28,12 +34,6 @@ import org.slf4j.LoggerFactory;
 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>=
index 19eab0a..daf1639 100644 (file)
@@ -20,6 +20,9 @@
 
 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;
@@ -36,9 +39,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
-import java.util.Map;
-import java.util.Map.Entry;
-
 @Component
 public class AuditingManager {
 
index 8c6b7dd..9a71adb 100644 (file)
@@ -1,9 +1,21 @@
 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;
@@ -50,21 +62,11 @@ import org.slf4j.Logger;
 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")
index 0519f43..2730ee4 100644 (file)
@@ -1,5 +1,14 @@
 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;
@@ -14,14 +23,6 @@ import org.slf4j.Logger;
 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 {
 
index 9c46c68..9a5bc33 100644 (file)
 
 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;
index 3251f3d..c52bad9 100644 (file)
 
 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;
index d6fee9a..ffac784 100644 (file)
 
 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;
@@ -37,25 +56,8 @@ import com.att.nsa.cambria.client.CambriaPublisher.message;
 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 {
index 94fff3c..780a40c 100644 (file)
@@ -1,12 +1,12 @@
 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 {
 
index 7d2d468..19878c3 100644 (file)
 
 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;
@@ -36,14 +49,6 @@ import org.slf4j.LoggerFactory;
 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 {
 
index 9599879..48533f1 100644 (file)
 
 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 {
 
index 1759f69..043efdf 100644 (file)
 
 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;
@@ -30,14 +38,7 @@ import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
 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 {
 
index b4f4863..d41d334 100644 (file)
 
 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;
@@ -35,10 +36,11 @@ import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
 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 {
 
index 3d35a84..9c4f8e1 100644 (file)
@@ -1,18 +1,20 @@
 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
index e0661f4..ef81b39 100644 (file)
@@ -1,6 +1,11 @@
 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;
@@ -8,11 +13,7 @@ import org.slf4j.LoggerFactory;
 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
index ba5e9f7..a215efd 100644 (file)
@@ -1,17 +1,9 @@
 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;
@@ -22,8 +14,18 @@ import java.util.concurrent.ScheduledFuture;
 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 {
index 67977b6..d3937a4 100644 (file)
@@ -1,10 +1,10 @@
 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
index 822464c..dc83b72 100644 (file)
@@ -1,14 +1,22 @@
 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;
@@ -31,22 +39,16 @@ import org.slf4j.Logger;
 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
index 29579c6..43a86eb 100644 (file)
@@ -1,15 +1,16 @@
 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
index 9c478e7..a475730 100644 (file)
 
 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;
index dc58a24..4955cf4 100644 (file)
 
 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 {
 
index f3d1797..7ea8026 100644 (file)
 
 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;
@@ -37,8 +45,7 @@ import org.slf4j.LoggerFactory;
 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 {
index 7a25c2e..c962583 100644 (file)
 
 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();
index 8f0865f..e712a01 100644 (file)
 
 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;
index 4e06b0e..ef47f5e 100644 (file)
@@ -1,11 +1,11 @@
 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 {
 
index 76263f9..27488d6 100644 (file)
@@ -1,13 +1,18 @@
 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;
@@ -15,7 +20,8 @@ import org.slf4j.Logger;
 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 {
index 670350a..adcd31b 100644 (file)
 
 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;
@@ -46,27 +72,8 @@ import org.slf4j.LoggerFactory;
 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")
index 50331a7..90f2148 100644 (file)
 
 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;
@@ -41,7 +44,6 @@ import org.openecomp.sdc.be.model.operations.utils.ComponentValidationUtils;
 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;
@@ -49,8 +51,7 @@ import org.slf4j.LoggerFactory;
 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 {
index e79efbc..b7dfabf 100644 (file)
 
 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;
@@ -30,14 +38,6 @@ import org.openecomp.sdc.be.model.InterfaceDefinition;
 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 {
 
index c9250ae..c8fc13d 100644 (file)
 
 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;
@@ -109,26 +127,11 @@ import org.xml.sax.SAXNotSupportedException;
 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 {
index 6756108..bc813b9 100644 (file)
 
 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;
@@ -35,10 +39,7 @@ import org.slf4j.Logger;
 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.
index e401cb1..4b15081 100644 (file)
 
 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;
@@ -37,7 +43,16 @@ import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
 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;
@@ -68,13 +83,9 @@ import org.slf4j.Logger;
 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 {
 
index caf051e..b350c7b 100644 (file)
 
 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;
@@ -28,18 +35,12 @@ import org.openecomp.sdc.be.impl.ComponentsUtils;
 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 {
index 31db965..b4147b8 100644 (file)
@@ -1,18 +1,5 @@
 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;
@@ -23,6 +10,21 @@ import java.util.Map;
 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 {
 
index fa66289..dc83661 100644 (file)
 
 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;
@@ -39,12 +45,7 @@ import org.slf4j.LoggerFactory;
 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 {
index 055e479..88e5853 100644 (file)
 
 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;
@@ -35,16 +50,7 @@ import org.slf4j.LoggerFactory;
 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 {
index 4688aa4..deb6c3d 100644 (file)
 
 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;
@@ -39,7 +46,21 @@ import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
 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;
@@ -58,13 +79,7 @@ import org.slf4j.Logger;
 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 {
 
index 9d9d008..306fadd 100644 (file)
 
 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;
@@ -48,8 +63,25 @@ import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
 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;
@@ -70,12 +102,9 @@ import org.slf4j.Logger;
 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 {
index 90f8074..b591c9e 100644 (file)
 
 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;
@@ -31,14 +39,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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
index 44ab422..8ab124c 100644 (file)
@@ -20,7 +20,8 @@
 
 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;
@@ -34,14 +35,13 @@ import org.openecomp.sdc.be.resources.data.ConsumerData;
 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 {
index 6fbc224..2609dfc 100644 (file)
 
 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;
@@ -32,13 +44,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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 {
 
index aa5cb4e..e423e72 100644 (file)
 
 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;
@@ -36,14 +45,7 @@ import org.slf4j.Logger;
 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 {
index 5469d79..af5c03b 100644 (file)
 
 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;
@@ -41,7 +46,7 @@ import org.slf4j.LoggerFactory;
 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 {
index ac72c98..998ef62 100644 (file)
 
 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;
@@ -77,19 +90,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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 {
index 7233ba7..d8626ff 100644 (file)
@@ -1,6 +1,9 @@
 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;
@@ -15,9 +18,7 @@ import org.openecomp.sdc.be.model.operations.impl.GraphLockOperation;
 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.
index a2fd6c4..313a117 100644 (file)
 
 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;
@@ -72,21 +87,7 @@ import org.slf4j.Logger;
 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 {
index cdd1b30..d852ac3 100644 (file)
@@ -1,5 +1,8 @@
 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;
@@ -10,9 +13,6 @@ import org.openecomp.sdc.be.model.operations.impl.GroupTypeOperation;
 import org.openecomp.sdc.exception.ResponseFormat;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
-import java.util.Set;
-
 @Component
 public class GroupTypeBusinessLogic {
 
index 5cdb589..0485e3a 100644 (file)
 
 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;
@@ -38,13 +46,7 @@ import org.slf4j.Logger;
 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 {
index 3db76a9..4b9203d 100644 (file)
 
 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;
@@ -43,18 +52,11 @@ import org.yaml.snakeyaml.nodes.Tag;
 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() {
index 7b51e92..ca8b2e1 100644 (file)
 
 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;
@@ -47,13 +55,7 @@ import org.slf4j.Logger;
 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 {
index cfc2505..6d23cac 100644 (file)
 
 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;
@@ -32,12 +39,7 @@ import org.slf4j.Logger;
 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 {
index c04eb29..85f8c57 100644 (file)
 
 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;
@@ -49,14 +56,9 @@ import org.slf4j.LoggerFactory;
 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{
index 43cf9bd..31701c7 100644 (file)
@@ -20,7 +20,6 @@
 
 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;
@@ -30,6 +29,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
+import fj.data.Either;
+
 @Component("monitoringBusinessLogic")
 public class MonitoringBusinessLogic {
 
index fee8ba1..a65a23e 100644 (file)
@@ -1,6 +1,8 @@
 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;
@@ -13,8 +15,7 @@ import org.slf4j.Logger;
 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 {
index fed588f..7efff56 100644 (file)
 
 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;
@@ -36,10 +41,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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 {
index ab6ff24..f6a789b 100644 (file)
 
 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;
@@ -47,13 +54,7 @@ import org.slf4j.Logger;
 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 {
index 9cc4b9c..aeab3cd 100644 (file)
 
 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;
@@ -51,12 +57,9 @@ import org.slf4j.LoggerFactory;
 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 {
index bac9bb6..fd1a272 100644 (file)
 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;
@@ -40,7 +57,6 @@ import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction;
 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;
@@ -134,24 +150,9 @@ import org.yaml.snakeyaml.DumperOptions;
 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 {
index 97dcf35..6d6d80b 100644 (file)
 
 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;
@@ -70,19 +84,7 @@ import org.springframework.stereotype.Component;
 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 {
index 14db140..48cbb35 100644 (file)
 
 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;
@@ -92,21 +105,11 @@ import org.slf4j.LoggerFactory;
 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 {
index 236be43..94d4373 100644 (file)
@@ -1,6 +1,9 @@
 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;
@@ -17,9 +20,7 @@ import org.slf4j.Logger;
 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 {
index 30a93fa..50f64e2 100644 (file)
@@ -1,14 +1,14 @@
 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() {
index df98a7f..1b6f49d 100644 (file)
@@ -1,5 +1,10 @@
 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;
@@ -9,11 +14,6 @@ import org.openecomp.sdc.be.model.GroupDefinition;
 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 {
 
index 8824b2e..1d27228 100644 (file)
@@ -1,5 +1,10 @@
 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;
@@ -10,11 +15,6 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
 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 {
 
index ee37536..375d8e6 100644 (file)
@@ -1,14 +1,14 @@
 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 {
 
index c229d87..42fe6ba 100644 (file)
@@ -20,7 +20,7 @@
 
 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;
@@ -45,7 +45,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Arrays;
+import fj.data.Either;
 
 public class CertificationChangeTransition extends LifeCycleTransition {
 
index dfd7bee..4a8bbb5 100644 (file)
 
 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;
@@ -31,7 +37,15 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
 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;
@@ -46,7 +60,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.*;
+import fj.data.Either;
 
 public class CertificationRequestTransition extends LifeCycleTransition {
 
index 0d9631e..9015ca0 100644 (file)
@@ -20,7 +20,8 @@
 
 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;
@@ -42,7 +43,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Arrays;
+import fj.data.Either;
 
 public class CheckinTransition extends LifeCycleTransition {
 
index e5afcae..3d1ba33 100644 (file)
@@ -20,7 +20,9 @@
 
 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;
@@ -30,7 +32,11 @@ import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
 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;
@@ -43,8 +49,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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 {
 
index 4270295..dc25243 100644 (file)
 
 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;
@@ -42,9 +45,7 @@ import org.openecomp.sdc.be.user.Role;
 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 {
 
index 5e65ede..703e0f9 100644 (file)
 
 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;
@@ -59,9 +63,7 @@ import org.slf4j.Logger;
 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 {
index 9444faa..07b5dc0 100644 (file)
@@ -20,7 +20,7 @@
 
 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;
@@ -44,7 +44,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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);
index e6dd645..9c140b3 100644 (file)
@@ -1,6 +1,9 @@
 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;
@@ -9,9 +12,7 @@ import org.openecomp.sdc.be.model.Resource;
 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 {
index 4bd7998..eb359e9 100644 (file)
@@ -1,6 +1,7 @@
 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;
@@ -10,7 +11,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
+import fj.data.Either;
 
 @Component
 public class GlobalTypesMergeBusinessLogic implements MergeResourceBusinessLogic {
index 058d4c2..ab47837 100644 (file)
@@ -1,15 +1,15 @@
 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 {
 
index 0f68f9f..8b48b08 100644 (file)
@@ -1,6 +1,8 @@
 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;
@@ -13,8 +15,7 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
 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 {
index 0a467ef..5d616c1 100644 (file)
@@ -1,12 +1,12 @@
 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 {
 
     /**
index 8400b32..d09a00c 100644 (file)
@@ -1,5 +1,13 @@
 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;
@@ -7,10 +15,6 @@ import org.openecomp.sdc.be.model.CapabilityDefinition;
 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 {
 
index 82deee5..1e1bc86 100644 (file)
@@ -1,15 +1,15 @@
 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.
  */
index be5e536..96ad87c 100644 (file)
@@ -1,6 +1,10 @@
 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;
@@ -10,10 +14,7 @@ import org.openecomp.sdc.be.model.InputDefinition;
 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 {
index e0e7947..e49d2b2 100644 (file)
@@ -1,5 +1,12 @@
 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;
@@ -7,9 +14,6 @@ import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
 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 {
 
index e7117a2..caf7318 100644 (file)
@@ -1,6 +1,8 @@
 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;
@@ -16,8 +18,7 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
 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 {
index d16fa25..5571bdc 100644 (file)
@@ -1,6 +1,10 @@
 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;
@@ -12,10 +16,7 @@ import org.openecomp.sdc.common.api.Constants;
 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.
index afad19b..b43e263 100644 (file)
@@ -1,6 +1,12 @@
 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;
@@ -9,12 +15,7 @@ import org.openecomp.sdc.be.model.ComponentInstance;
 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 {
index 20a5abc..5824b43 100644 (file)
@@ -1,6 +1,12 @@
 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;
@@ -19,12 +25,7 @@ import org.slf4j.Logger;
 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 {
index 3938281..f66eaa8 100644 (file)
@@ -1,6 +1,8 @@
 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;
@@ -15,8 +17,7 @@ import org.slf4j.Logger;
 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.
index 2e28945..c233205 100644 (file)
@@ -1,6 +1,9 @@
 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;
@@ -11,9 +14,7 @@ import org.openecomp.sdc.be.model.InputDefinition;
 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 {
index d17469a..111b1b3 100644 (file)
@@ -1,6 +1,7 @@
 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;
@@ -14,7 +15,7 @@ import org.slf4j.Logger;
 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.
  */
index f4bcfda..1d2849b 100644 (file)
@@ -1,11 +1,12 @@
 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.
  */
index 99b1d38..fe2de78 100644 (file)
@@ -1,6 +1,9 @@
 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;
@@ -10,9 +13,7 @@ import org.openecomp.sdc.be.model.InputDefinition;
 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 {
index b63cc38..82e6b63 100644 (file)
@@ -1,10 +1,18 @@
 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;
@@ -12,8 +20,7 @@ import org.slf4j.Logger;
 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.
index ac09598..636bdda 100644 (file)
@@ -6,6 +6,7 @@ import java.util.HashMap;
 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;
index 139ac38..bc2f71e 100644 (file)
@@ -1,12 +1,12 @@
 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  {
 
index df65c11..63a7a1b 100644 (file)
@@ -1,10 +1,10 @@
 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.
index 318840d..7356b44 100644 (file)
@@ -1,7 +1,14 @@
 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;
@@ -14,9 +21,9 @@ import org.slf4j.Logger;
 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 {
index df30305..09f26a3 100644 (file)
@@ -1,15 +1,15 @@
 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();
index 9fcb864..88601bb 100644 (file)
@@ -1,13 +1,13 @@
 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);
index ce0ed0e..39381e7 100644 (file)
@@ -1,9 +1,9 @@
 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 {
 
index cdfeded..9d11eb9 100644 (file)
@@ -1,13 +1,14 @@
 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 {
 
index 0ffe693..f990122 100644 (file)
@@ -1,5 +1,7 @@
 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;
@@ -7,8 +9,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
-
 @Component
 public class ResourceDataMergeBusinessLogic implements MergeResourceBusinessLogic {
 
index 4ff7e06..132ad10 100644 (file)
@@ -1,6 +1,14 @@
 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;
@@ -14,10 +22,8 @@ import org.slf4j.LoggerFactory;
 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
index 469ae31..492d0a1 100644 (file)
@@ -1,6 +1,9 @@
 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;
@@ -15,9 +18,7 @@ import org.slf4j.LoggerFactory;
 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 {
index f598316..660c7b7 100644 (file)
@@ -1,6 +1,11 @@
 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;
@@ -15,11 +20,7 @@ import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
 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> {
index ab4c4e2..81e7fc0 100644 (file)
@@ -1,6 +1,11 @@
 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;
@@ -15,11 +20,7 @@ import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
 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> {
index e053096..28bb30d 100644 (file)
@@ -1,7 +1,17 @@
 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;
@@ -24,17 +34,9 @@ import org.slf4j.Logger;
 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 {
 
index be3c82f..a2a146b 100644 (file)
@@ -1,6 +1,14 @@
 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;
@@ -15,14 +23,7 @@ import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
 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> {
index ea311ce..373dd4a 100644 (file)
@@ -1,6 +1,8 @@
 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;
@@ -11,8 +13,7 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
 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 {
index 9255763..8314309 100644 (file)
@@ -1,12 +1,13 @@
 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 {
 
index df6cb3f..8ab616e 100644 (file)
@@ -1,11 +1,11 @@
 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();
index a2659f4..e89c02e 100644 (file)
 
 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;
@@ -30,16 +41,6 @@ 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.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 {
 
index a09a781..d26b212 100644 (file)
 
 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;
@@ -32,9 +35,7 @@ import org.slf4j.LoggerFactory;
 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 {
index eac4ecf..8fd7fbf 100644 (file)
 
 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;
@@ -37,18 +49,9 @@ import org.slf4j.LoggerFactory;
 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 {
index 83f5a5d..f7c639f 100644 (file)
@@ -1,15 +1,16 @@
 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);
index 002ae50..c2722b5 100644 (file)
 
 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;
@@ -41,12 +44,6 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
 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 {
index 439c8bd..aa58c14 100644 (file)
 
 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;
@@ -35,13 +42,7 @@ import org.slf4j.LoggerFactory;
 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 {
index c1934ae..c1af083 100644 (file)
@@ -1,6 +1,10 @@
 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;
@@ -15,10 +19,7 @@ import org.openecomp.sdc.common.util.ValidationUtils;
 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
index ec5a1c3..c9ae17c 100644 (file)
@@ -1,6 +1,10 @@
 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;
@@ -19,9 +23,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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.
index e2e671f..a0c8d9f 100644 (file)
@@ -1,6 +1,7 @@
 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;
@@ -13,7 +14,7 @@ import org.openecomp.sdc.exception.ResponseFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
+import fj.data.Either;
 
 @org.springframework.stereotype.Component
 public class UserValidations {
index 9f0d7a3..8310330 100644 (file)
 
 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;
@@ -35,6 +27,11 @@ import java.util.Map;
 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 {
index 27b1b7e..78b2354 100644 (file)
 
 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 () {
index 624a8b6..26da552 100644 (file)
 
 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 {
 
index 2c2adaa..20378e0 100644 (file)
 
 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 {
index 984a831..ead0e98 100644 (file)
 
 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.
index b5c322f..3d4e048 100644 (file)
 
 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;
@@ -37,7 +48,6 @@ import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
 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;
@@ -45,14 +55,17 @@ 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.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.
index 6ffa3a7..8aee1fb 100644 (file)
 
 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;
@@ -40,9 +44,7 @@ import org.slf4j.LoggerFactory;
 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 {
index b02a4a5..eb227a5 100644 (file)
 
 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;
@@ -37,7 +52,7 @@ import org.slf4j.Logger;
 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 {
index 590be72..f0c8ec2 100644 (file)
 
 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 {
 
index b634abb..f98c737 100644 (file)
 
 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;
@@ -45,25 +57,16 @@ 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.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.
  * 
index 27f82df..92862b5 100644 (file)
 
 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;
@@ -44,19 +61,14 @@ 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.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.
index 0651291..67922ca 100644 (file)
 
 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;
@@ -43,7 +59,11 @@ import org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum;
 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;
@@ -51,7 +71,6 @@ import org.openecomp.sdc.be.servlets.AbstractValidationsServlet;
 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;
@@ -59,19 +78,17 @@ 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.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")
index 7e48890..a459e3d 100644 (file)
@@ -1,6 +1,23 @@
 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;
@@ -13,13 +30,7 @@ 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 java.util.List;
-import java.util.Map;
+import fj.data.Either;
 
 
 @Path("/v1/catalog")
index 3f1bf18..e5f6dcd 100644 (file)
@@ -1,9 +1,21 @@
 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;
@@ -21,15 +33,15 @@ 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.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.
index 841cd32..a13cc51 100644 (file)
 
 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;
@@ -36,18 +47,10 @@ import org.slf4j.Logger;
 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 {
index 60409b3..9a46514 100644 (file)
 
 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;
@@ -29,7 +42,6 @@ import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
 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;
@@ -37,18 +49,7 @@ import org.slf4j.LoggerFactory;
 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)
index b80ee4c..c949154 100644 (file)
 
 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;
@@ -34,18 +46,8 @@ import org.slf4j.Logger;
 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 {
index 5602704..41681a7 100644 (file)
 
 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;
@@ -74,12 +74,14 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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 {
index b268554..445f8d9 100644 (file)
 
 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;
@@ -35,15 +43,10 @@ import org.openecomp.sdc.common.api.Constants;
 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 {
 
index 2158508..ec3e146 100644 (file)
@@ -1,7 +1,5 @@
 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;
@@ -10,6 +8,7 @@ import java.util.Map;
 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;
@@ -25,6 +24,9 @@ import org.openecomp.sdc.be.model.Component;
 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";
index c8128a3..6e078cf 100644 (file)
 
 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 {
index 0275928..7d4c09d 100644 (file)
 
 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) {
index 9b8e81c..141dd7b 100644 (file)
 
 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;
@@ -35,7 +38,10 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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";
index 5d635f0..da7f178 100644 (file)
 
 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;
index f49315c..1f36382 100644 (file)
 
 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;
 
index e4b6f35..d5da29f 100644 (file)
 
 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;
index 766581b..2aef780 100644 (file)
@@ -1,12 +1,12 @@
 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;
index 4d27713..f49722a 100644 (file)
@@ -1,14 +1,15 @@
 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
index fba6632..5fd51e3 100644 (file)
@@ -1,10 +1,10 @@
 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")
index 216e55a..0b0b862 100644 (file)
@@ -1,10 +1,11 @@
 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 {
 
index 0fd86e1..b008172 100644 (file)
@@ -1,10 +1,11 @@
 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 {
 
index ba6596d..c3b4f6e 100644 (file)
 
 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;
@@ -30,11 +36,6 @@ import org.slf4j.Logger;
 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;
index b67469d..a995d61 100644 (file)
 
 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;
@@ -60,22 +74,11 @@ import org.slf4j.Logger;
 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 {
 
index f6d89e9..f067810 100644 (file)
 
 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;
@@ -31,19 +44,19 @@ import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
 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")
index fa7ed4b..ad4009d 100644 (file)
 
 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;
@@ -56,7 +36,30 @@ 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.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)
  */
index 09ebb1c..90b5316 100644 (file)
 
 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;
@@ -36,13 +46,16 @@ 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.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
  * 
index 937ec87..9d23184 100644 (file)
 
 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;
@@ -59,14 +64,11 @@ import org.slf4j.Logger;
 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 {
 
index aa10ce0..516ba57 100644 (file)
 
 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;
@@ -37,21 +43,21 @@ import org.openecomp.sdc.be.impl.WebAppContextWrapper;
 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")
index 8ed68fa..fb226bb 100644 (file)
@@ -1,15 +1,16 @@
 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
index 536fdc3..072ab0c 100644 (file)
 
 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;
@@ -56,28 +69,18 @@ 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.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
index 16fa67e..e1abe42 100644 (file)
 
 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;
@@ -46,24 +59,14 @@ 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.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")
index f8aa39c..f307baa 100644 (file)
 
 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;
@@ -28,11 +39,7 @@ 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.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
+import com.jcabi.aspects.Loggable;
 
 /**
  * Root resource (exposed at "/" path)
index a56065f..daa21ac 100644 (file)
 
 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;
@@ -36,6 +28,15 @@ import javax.ws.rs.Produces;
 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)
  */
index fda31e5..038a9de 100644 (file)
 
 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;
@@ -32,19 +43,20 @@ 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.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")
index faf02dc..2dca008 100644 (file)
 
 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;
@@ -31,6 +27,12 @@ import javax.ws.rs.PathParam;
 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 {
index 40de94b..c362956 100644 (file)
@@ -1,12 +1,12 @@
 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> {
index dca4121..7ab3656 100644 (file)
 
 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;
@@ -33,20 +41,18 @@ import org.openecomp.sdc.be.impl.WebAppContextWrapper;
 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)
  */
index 1a6fb20..06f0fed 100644 (file)
 
 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;
@@ -32,8 +50,12 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
 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;
@@ -41,22 +63,18 @@ import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
 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/")
 
index 100fd36..0309e23 100644 (file)
 
 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;
@@ -57,7 +37,30 @@ 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.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)
index a056b1d..ef6c1c5 100644 (file)
@@ -1,17 +1,6 @@
 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;
@@ -20,7 +9,21 @@ import javax.ws.rs.Path;
 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")
index 1d627e6..0ebed15 100644 (file)
 
 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;
@@ -41,28 +51,20 @@ import org.openecomp.sdc.be.model.Resource;
 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")
index 5720c56..2bcea25 100644 (file)
 
 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;
@@ -37,18 +46,19 @@ import org.openecomp.sdc.be.model.User;
 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")
index b6e15ce..4842d66 100644 (file)
@@ -1,11 +1,24 @@
 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;
@@ -17,25 +30,20 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
 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
index aa4bfa8..d440ca6 100644 (file)
@@ -1,11 +1,14 @@
 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;
@@ -15,14 +18,13 @@ import org.slf4j.Logger;
 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")
index 05ece30..9633f44 100644 (file)
 
 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")
index 14d2628..557091e 100644 (file)
 
 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;
@@ -41,25 +58,22 @@ import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyCons
 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")
index ea6b34a..1a3b988 100644 (file)
 
 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;
@@ -38,6 +27,7 @@ import java.util.HashMap;
 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;
@@ -50,6 +40,18 @@ import org.openecomp.sdc.common.api.Constants;
 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);
index e8769cc..612d626 100644 (file)
 
 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;
@@ -37,11 +39,10 @@ import org.slf4j.LoggerFactory;
 
 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 {
index 5d4001e..d33bb8e 100644 (file)
 
 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;
@@ -36,14 +41,11 @@ import org.openecomp.sdc.common.api.Constants;
 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")
index b51fc00..68aa707 100644 (file)
 
 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;
@@ -46,27 +61,15 @@ 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.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")
index 2508423..ca07b31 100644 (file)
 
 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;
@@ -31,21 +47,18 @@ import org.openecomp.sdc.be.impl.WebAppContextWrapper;
 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)
index db0d4fb..ef94464 100644 (file)
 
 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;
@@ -40,24 +60,19 @@ import org.openecomp.sdc.be.model.User;
 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")
index f794e8c..d51ef4c 100644 (file)
@@ -1,15 +1,8 @@
 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;
@@ -25,6 +18,7 @@ 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.MapUtils;
 import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic;
 import org.openecomp.sdc.be.config.BeEcompErrorManager;
@@ -42,6 +36,16 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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)
index 49a1a82..ba5a706 100644 (file)
 
 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;
@@ -40,17 +60,16 @@ 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.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")
index fce8dd0..930cb90 100644 (file)
@@ -1,17 +1,18 @@
 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
index a30cd3c..52fb809 100644 (file)
 
 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();
 
index 9829566..b586327 100644 (file)
 
 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;
@@ -33,21 +41,19 @@ import org.openecomp.sdc.be.impl.WebAppContextWrapper;
 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")
index 92f15c4..8cb3cbd 100644 (file)
 
 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;
@@ -49,39 +60,15 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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")
index c9ea5dd..7f7c1a8 100644 (file)
 
 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;
@@ -52,10 +40,25 @@ 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.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")
index fb5710c..c461970 100644 (file)
 
 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;
@@ -31,17 +43,6 @@ import org.slf4j.Logger;
 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 {
 
index be56ff3..e52dc3a 100644 (file)
 
 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;
index 4dbbf92..f544eed 100644 (file)
 
 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
index 3c95539..2cf7319 100644 (file)
@@ -20,8 +20,6 @@
 
 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;
@@ -43,6 +41,7 @@ import java.util.stream.Collectors;
 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;
@@ -50,6 +49,11 @@ import org.apache.commons.lang.WordUtils;
 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;
@@ -89,15 +93,14 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration;
 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
index 8ca4926..9f5ebdf 100644 (file)
@@ -23,7 +23,6 @@ package org.openecomp.sdc.be.tosca;
 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;
@@ -36,6 +35,7 @@ import java.util.Optional;
 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;
@@ -102,6 +102,8 @@ import org.yaml.snakeyaml.nodes.Tag;
 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 {
 
index 49fd91c..4dc60fc 100644 (file)
 
 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;
index 8abaaf7..5119177 100644 (file)
 
 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) {
index 2b3889e..f13fd1c 100644 (file)
@@ -22,6 +22,7 @@ package org.openecomp.sdc.be.tosca.model;
 
 import java.util.List;
 import java.util.Map;
+
 import org.apache.commons.lang3.tuple.Triple;
 import org.openecomp.sdc.be.model.Component;
 
index c4905d0..eb187e0 100644 (file)
@@ -1,6 +1,13 @@
 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;
@@ -13,7 +20,7 @@ import org.openecomp.sdc.be.tosca.CapabiltyRequirementConvertor;
 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
index 02e7c89..01733db 100644 (file)
 
 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;
@@ -35,6 +35,8 @@ import org.openecomp.sdc.be.tosca.model.ToscaLifecycleOperationDefinition;
 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
index 8fe8afc..82c7623 100644 (file)
@@ -17,6 +17,7 @@
 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;
 
index ee454d7..c3a7182 100644 (file)
 
 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;
 
 /**
  * 
index 324019a..794de4a 100644 (file)
 
 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;
@@ -34,7 +41,6 @@ import org.openecomp.sdc.be.model.operations.api.IUserAdminOperation;
 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;
@@ -42,12 +48,7 @@ import org.slf4j.LoggerFactory;
 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 {
index e3d6ca6..c7754ed 100644 (file)
@@ -1,12 +1,5 @@
 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;
@@ -16,6 +9,14 @@ import java.util.Objects;
 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.
  */
index ea04135..f867666 100644 (file)
 
 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();
 
index a440739..8be443b 100644 (file)
 
 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
index e17819f..add15d3 100644 (file)
 
 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;
@@ -34,6 +32,8 @@ import org.openecomp.sdc.common.util.MethodActivationStatusEnum;
 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);
index f366ae2..d870692 100644 (file)
@@ -20,8 +20,9 @@
 
 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;
@@ -29,8 +30,6 @@ import org.openecomp.sdc.common.transaction.api.TransactionUtils.LogMessages;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-
 public class CommitManager {
 
     // TODO test using slf4j-test and make this final
index f218744..d4c5291 100644 (file)
 
 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;
@@ -31,9 +34,8 @@ import org.slf4j.Logger;
 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 {
index bc7b5bd..1dda149 100644 (file)
 
 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;
@@ -36,8 +47,7 @@ import org.openecomp.sdc.common.util.MethodActivationStatusEnum;
 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 {
 
index 2088e80..d87f01d 100644 (file)
 
 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;
@@ -35,9 +38,7 @@ import org.openecomp.sdc.be.model.operations.api.IElementOperation;
 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 {
 
index 7f5b7f9..9b8237c 100644 (file)
 
 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;
@@ -33,10 +37,6 @@ import org.openecomp.sdc.common.impl.FSConfigurationSource;
 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);
index 4698c0e..b6b0069 100644 (file)
@@ -20,6 +20,8 @@
 
 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;
@@ -29,8 +31,6 @@ import org.openecomp.sdc.common.impl.ConfigFileChangeListener;
 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 {
index 9ee123a..0b95bae 100644 (file)
@@ -20,9 +20,6 @@
 
 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;
@@ -33,6 +30,9 @@ import java.util.Map;
 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) {
index 84c6fc1..a6c8dc4 100644 (file)
@@ -1,13 +1,13 @@
 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);
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditAuthRequestEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditAuthRequestEventFactoryTest.java
new file mode 100644 (file)
index 0000000..db70cfd
--- /dev/null
@@ -0,0 +1,35 @@
+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
index 9bdf784..e59ae40 100644 (file)
@@ -1,9 +1,5 @@
 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;
@@ -13,6 +9,10 @@ import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.USER_ID;
 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();
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactoryTest.java
new file mode 100644 (file)
index 0000000..b550aea
--- /dev/null
@@ -0,0 +1,54 @@
+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
index 0a90ffd..bf3c7c4 100644 (file)
@@ -1,28 +1,5 @@
 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;
@@ -44,6 +21,29 @@ import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.USER_ID;
 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;
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditEcompOpEnvEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditEcompOpEnvEventFactoryTest.java
new file mode 100644 (file)
index 0000000..b181bbf
--- /dev/null
@@ -0,0 +1,32 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditResourceEventFactoryManangerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditResourceEventFactoryManangerTest.java
new file mode 100644 (file)
index 0000000..bad63c7
--- /dev/null
@@ -0,0 +1,42 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatUtilTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatUtilTest.java
new file mode 100644 (file)
index 0000000..37f8106
--- /dev/null
@@ -0,0 +1,96 @@
+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
index a774dea..e41e34b 100644 (file)
@@ -1,5 +1,26 @@
 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;
@@ -21,27 +42,6 @@ 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.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;
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/category/AuditGetCategoryHierarchyEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/category/AuditGetCategoryHierarchyEventFactoryTest.java
new file mode 100644 (file)
index 0000000..f5f6dde
--- /dev/null
@@ -0,0 +1,38 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditCreateTopicDistribEngineEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditCreateTopicDistribEngineEventFactoryTest.java
new file mode 100644 (file)
index 0000000..c50ea24
--- /dev/null
@@ -0,0 +1,24 @@
+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
index 199597b..29285e7 100644 (file)
@@ -1,28 +1,5 @@
 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;
@@ -44,6 +21,29 @@ import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.SERVICE_INSTANCE
 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;
index 09a168a..ceb25e4 100644 (file)
@@ -1,34 +1,5 @@
 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;
@@ -63,6 +34,35 @@ import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.VNF_WORKLOAD_CON
 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 {
 
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribDeployEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribDeployEventFactoryTest.java
new file mode 100644 (file)
index 0000000..6a314da
--- /dev/null
@@ -0,0 +1,36 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribDownloadEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribDownloadEventFactoryTest.java
new file mode 100644 (file)
index 0000000..3aaeb6f
--- /dev/null
@@ -0,0 +1,36 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribNotificationEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribNotificationEventFactoryTest.java
new file mode 100644 (file)
index 0000000..06b45a4
--- /dev/null
@@ -0,0 +1,38 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribStatusEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistribStatusEventFactoryTest.java
new file mode 100644 (file)
index 0000000..a9b5e68
--- /dev/null
@@ -0,0 +1,35 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditGetUebClusterEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditGetUebClusterEventFactoryTest.java
new file mode 100644 (file)
index 0000000..10608ab
--- /dev/null
@@ -0,0 +1,35 @@
+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
index f859b75..8dd6680 100644 (file)
@@ -1,5 +1,23 @@
 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;
@@ -20,24 +38,6 @@ import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
 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 {
 
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditActivateServiceExternalApiEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditActivateServiceExternalApiEventFactoryTest.java
new file mode 100644 (file)
index 0000000..908399a
--- /dev/null
@@ -0,0 +1,29 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditChangeLifecycleExternalApiEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditChangeLifecycleExternalApiEventFactoryTest.java
new file mode 100644 (file)
index 0000000..d639471
--- /dev/null
@@ -0,0 +1,28 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditCreateResourceExternalApiEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditCreateResourceExternalApiEventFactoryTest.java
new file mode 100644 (file)
index 0000000..414920e
--- /dev/null
@@ -0,0 +1,28 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditDownloadArtifactExternalApiEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/externalapi/AuditDownloadArtifactExternalApiEventFactoryTest.java
new file mode 100644 (file)
index 0000000..bf5f03c
--- /dev/null
@@ -0,0 +1,28 @@
+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
index 7ddc9a0..1ddda9e 100644 (file)
@@ -1,28 +1,5 @@
 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;
@@ -54,6 +31,29 @@ import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.STATUS_OK;
 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 {
 
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditArtifactResourceAdminEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditArtifactResourceAdminEventFactoryTest.java
new file mode 100644 (file)
index 0000000..51c9553
--- /dev/null
@@ -0,0 +1,29 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditCertificationResourceAdminEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditCertificationResourceAdminEventFactoryTest.java
new file mode 100644 (file)
index 0000000..a9de5b0
--- /dev/null
@@ -0,0 +1,29 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditCreateUpdateResourceAdminEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditCreateUpdateResourceAdminEventFactoryTest.java
new file mode 100644 (file)
index 0000000..357d2e2
--- /dev/null
@@ -0,0 +1,29 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditDistStateChangeRequestResourceAdminEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditDistStateChangeRequestResourceAdminEventFactoryTest.java
new file mode 100644 (file)
index 0000000..20b65c5
--- /dev/null
@@ -0,0 +1,28 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditDistStateChangeResourceAdminEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditDistStateChangeResourceAdminEventFactoryTest.java
new file mode 100644 (file)
index 0000000..d3900ee
--- /dev/null
@@ -0,0 +1,29 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditImportResourceAdminEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/resourceadmin/AuditImportResourceAdminEventFactoryTest.java
new file mode 100644 (file)
index 0000000..ff033da
--- /dev/null
@@ -0,0 +1,29 @@
+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
index 18bd41c..8478803 100644 (file)
@@ -1,33 +1,5 @@
 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;
@@ -62,6 +34,34 @@ import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.TOSCA_NODE_TYPE;
 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;
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditGetUsersListEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditGetUsersListEventFactoryTest.java
new file mode 100644 (file)
index 0000000..8b74764
--- /dev/null
@@ -0,0 +1,35 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditUserAccessEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditUserAccessEventFactoryTest.java
new file mode 100644 (file)
index 0000000..df6245d
--- /dev/null
@@ -0,0 +1,35 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditUserAdminEventFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/auditing/impl/usersadmin/AuditUserAdminEventFactoryTest.java
new file mode 100644 (file)
index 0000000..6c46902
--- /dev/null
@@ -0,0 +1,37 @@
+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
index 4a5b1bb..f454a4b 100644 (file)
@@ -1,32 +1,5 @@
 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;
@@ -59,6 +32,33 @@ import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.init;
 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
index 06c22bc..b9f65f5 100644 (file)
 
 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;
@@ -32,12 +38,6 @@ import org.openecomp.sdc.be.dao.impl.AuditingDao;
 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 {
 
index bbd827e..a8c0147 100644 (file)
@@ -1,7 +1,15 @@
 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;
@@ -47,14 +55,9 @@ import org.slf4j.Logger;
 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";
index d7bfdcd..95a649f 100644 (file)
 
 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;
@@ -42,12 +48,7 @@ import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer;
 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 {
index c114f34..a2dfd90 100644 (file)
 
 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;
@@ -42,10 +46,6 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration;
 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
index 04c2100..11d2496 100644 (file)
 
 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();
index 18116a4..f38848c 100644 (file)
 
 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,
index f9412c1..a218b8b 100644 (file)
@@ -1,9 +1,16 @@
 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;
@@ -23,16 +30,11 @@ import org.openecomp.sdc.be.model.Service;
 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";
index 38aaf92..120077e 100644 (file)
 
 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;
@@ -52,17 +63,8 @@ import org.slf4j.Logger;
 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 {
 
index 8238982..6488482 100644 (file)
 
 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;
@@ -55,15 +64,7 @@ import org.openecomp.sdc.common.impl.FSConfigurationSource;
 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 {
 
index e750d3a..e74a84c 100644 (file)
 
 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) {
index bbb381b..f9c75d4 100644 (file)
 
 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;
@@ -71,21 +87,7 @@ import org.slf4j.Logger;
 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 {
 
index fe71526..86b8b56 100644 (file)
@@ -1,6 +1,10 @@
 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;
@@ -31,10 +35,7 @@ import org.openecomp.sdc.common.impl.FSConfigurationSource;
 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.
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/AaiMockRequestHandlerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/AaiMockRequestHandlerTest.java
deleted file mode 100644 (file)
index 7df88c1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-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);
-    } 
-}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/AaiRequestHandlerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/AaiRequestHandlerTest.java
new file mode 100644 (file)
index 0000000..3a29821
--- /dev/null
@@ -0,0 +1,68 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/ArtifactInfoImplTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/ArtifactInfoImplTest.java
new file mode 100644 (file)
index 0000000..bbed75d
--- /dev/null
@@ -0,0 +1,311 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/CambriaErrorResponseTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/CambriaErrorResponseTest.java
new file mode 100644 (file)
index 0000000..e3bdecc
--- /dev/null
@@ -0,0 +1,103 @@
+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
index d425e6d..ae5dec4 100644 (file)
@@ -1,10 +1,19 @@
 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;
@@ -13,65 +22,315 @@ import org.mockito.Mock;
 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
index 45906c6..9903f4c 100644 (file)
@@ -1,7 +1,8 @@
 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;
@@ -14,8 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 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")
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealthTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealthTest.java
new file mode 100644 (file)
index 0000000..be25e4a
--- /dev/null
@@ -0,0 +1,157 @@
+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
index 04aa242..6f167a5 100644 (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;
@@ -31,13 +38,6 @@ import org.openecomp.sdc.common.api.ConfigurationSource;
 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
index 1fa0fc6..3d4462e 100644 (file)
 
 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;
@@ -29,11 +33,8 @@ import org.openecomp.sdc.be.components.BeConfDependentTest;
 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 {
 
index 03a6625..c77b86a 100644 (file)
 
 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;
@@ -36,17 +47,7 @@ import org.openecomp.sdc.common.api.ConfigurationSource;
 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 {
 
@@ -90,7 +91,115 @@ 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() {
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEnginePollingTaskTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEnginePollingTaskTest.java
new file mode 100644 (file)
index 0000000..ecbc1f9
--- /dev/null
@@ -0,0 +1,107 @@
+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
index b1a43ea..c1a13f2 100644 (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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionStatusNotificationTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionStatusNotificationTest.java
new file mode 100644 (file)
index 0000000..2dbec7a
--- /dev/null
@@ -0,0 +1,156 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapClientFactoryTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapClientFactoryTest.java
new file mode 100644 (file)
index 0000000..b27c5b0
--- /dev/null
@@ -0,0 +1,133 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapConsumerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapConsumerTest.java
new file mode 100644 (file)
index 0000000..b35f337
--- /dev/null
@@ -0,0 +1,35 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealthTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealthTest.java
new file mode 100644 (file)
index 0000000..1c5199e
--- /dev/null
@@ -0,0 +1,104 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapNotificationDataImplTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DmaapNotificationDataImplTest.java
new file mode 100644 (file)
index 0000000..16d8298
--- /dev/null
@@ -0,0 +1,40 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentMessageBusDataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentMessageBusDataTest.java
new file mode 100644 (file)
index 0000000..a0be844
--- /dev/null
@@ -0,0 +1,121 @@
+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
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngineMockTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngineMockTest.java
new file mode 100644 (file)
index 0000000..d239679
--- /dev/null
@@ -0,0 +1,191 @@
+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;
+    }
+
+}
index 9b196e5..0c1f3a7 100644 (file)
@@ -1,11 +1,6 @@
 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;
index 1a2ca48..31da6e8 100644 (file)
@@ -1,15 +1,11 @@
 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;
@@ -28,11 +24,17 @@ import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
 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 {
 
index 9d0e8cd..fdf2ebf 100644 (file)
@@ -1,10 +1,16 @@
 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;
@@ -13,13 +19,19 @@ import org.openecomp.sdc.be.components.distribution.engine.DistributionStatusNot
 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 {
 
index 5c8b905..c7b55f2 100644 (file)
@@ -1,11 +1,10 @@
 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 {
 
index a7529ed..ea4df1e 100644 (file)
@@ -1,19 +1,12 @@
 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 {
index 4ce0740..a9140f5 100644 (file)
 
 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;
@@ -72,25 +84,15 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration;
 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 {
 
index dc89156..fa0366f 100644 (file)
 
 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;
@@ -30,13 +37,6 @@ import org.openecomp.sdc.be.model.Operation;
 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();
index 9b2fb37..9f5fdb8 100644 (file)
 
 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;
@@ -36,16 +46,7 @@ import org.openecomp.sdc.be.model.operations.impl.CapabilityTypeOperation;
 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
index 8a07e26..353a6fe 100644 (file)
 
 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;
@@ -37,15 +46,7 @@ import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
 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
index d406244..011324c 100644 (file)
@@ -17,7 +17,6 @@ import java.util.function.BiPredicate;
 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;
@@ -32,7 +31,6 @@ 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.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;
index a9245d2..7ecd069 100644 (file)
@@ -1,35 +1,5 @@
 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;
@@ -70,6 +40,36 @@ import static org.openecomp.sdc.be.auditing.impl.AuditTestUtils.USER_FIRST_NAME;
 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 {
 
index 7b37b0e..5797516 100644 (file)
 
 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;
@@ -35,7 +29,13 @@ import java.util.Map;
 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();
index d91fa79..3c283ac 100644 (file)
 
 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" };
index 46ee852..f81e144 100644 (file)
@@ -1,6 +1,13 @@
 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;
@@ -30,13 +37,7 @@ import org.openecomp.sdc.be.resources.data.ServiceMetadataData;
 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.
index b65e77c..8597136 100644 (file)
 
 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;
@@ -42,10 +35,18 @@ import java.util.List;
 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
index 068f04a..f2c53f4 100644 (file)
 
 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;
@@ -39,17 +50,7 @@ import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
 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 {
 
index e726f60..97eeef9 100644 (file)
 
 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;
@@ -35,14 +43,7 @@ import org.openecomp.sdc.be.model.operations.api.IInterfaceLifecycleOperation;
 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 {
 
index bde1bbb..5a7d8af 100644 (file)
 
 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;
@@ -67,23 +85,7 @@ import org.openecomp.sdc.common.impl.FSConfigurationSource;
 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{
 
index 9aca920..f9c0a2f 100644 (file)
@@ -1,7 +1,21 @@
 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;
@@ -44,20 +58,7 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration;
 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 {
index ad3e6e8..dd92a0c 100644 (file)
@@ -1,6 +1,15 @@
 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;
@@ -28,14 +37,7 @@ 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 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 {
index 7dc12d9..009876e 100644 (file)
@@ -1,7 +1,18 @@
 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;
@@ -21,18 +32,9 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
 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 {
index 75aa10a..6d4d7a0 100644 (file)
 
 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;
@@ -40,8 +60,6 @@ import org.openecomp.sdc.be.config.ConfigurationManager;
 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;
@@ -51,10 +69,8 @@ import org.openecomp.sdc.be.model.ArtifactDefinition;
 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;
@@ -90,27 +106,7 @@ import org.slf4j.Logger;
 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{
 
index 3abf711..0c88a37 100644 (file)
 
 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;
@@ -53,15 +62,7 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration;
 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 {
 
index 5f4dfdc..309689a 100644 (file)
@@ -1,6 +1,12 @@
 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;
@@ -14,12 +20,7 @@ import org.openecomp.sdc.be.model.Resource;
 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 {
 
index 6b1b37e..8fd262d 100644 (file)
@@ -1,6 +1,12 @@
 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;
@@ -9,12 +15,7 @@ import org.openecomp.sdc.be.model.PropertyDefinition;
 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 {
index fe60712..6d7ae39 100644 (file)
@@ -1,6 +1,14 @@
 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;
@@ -22,14 +30,7 @@ import org.openecomp.sdc.be.model.Resource;
 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 {
index 0da59d1..5da782e 100644 (file)
@@ -1,5 +1,15 @@
 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;
@@ -18,16 +28,6 @@ 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 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 {
 
index ef239f9..c6fea4a 100644 (file)
@@ -1,5 +1,10 @@
 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;
@@ -9,11 +14,6 @@ import org.openecomp.sdc.be.dao.api.ActionStatus;
 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 {
 
index cfb5bb5..80f63e7 100644 (file)
@@ -20,7 +20,9 @@
 
 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;
@@ -32,8 +34,7 @@ import org.openecomp.sdc.be.model.User;
 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 {
 
index f9fb9c8..495483a 100644 (file)
 
 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;
@@ -48,12 +54,7 @@ import org.openecomp.sdc.be.tosca.ToscaExportHandler;
 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 {
index e60998b..457a336 100644 (file)
@@ -20,7 +20,9 @@
 
 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;
@@ -32,8 +34,7 @@ import org.openecomp.sdc.be.model.User;
 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 {
 
index 0826e5d..14cbcc8 100644 (file)
@@ -20,7 +20,9 @@
 
 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;
@@ -34,8 +36,7 @@ import org.openecomp.sdc.be.model.User;
 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 {
 
index 941af0d..d2903f5 100644 (file)
 
 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;
@@ -61,11 +67,7 @@ import org.slf4j.Logger;
 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);
index d5d6658..6ef2e86 100644 (file)
@@ -20,7 +20,9 @@
 
 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;
@@ -31,8 +33,7 @@ import org.openecomp.sdc.be.model.User;
 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 {
 
index 89b82b9..ab2e865 100644 (file)
@@ -1,7 +1,14 @@
 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;
@@ -17,14 +24,9 @@ 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 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 {
 
index ec741b4..a00b0b8 100644 (file)
@@ -1,6 +1,13 @@
 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;
@@ -11,13 +18,7 @@ import org.openecomp.sdc.be.dao.api.ActionStatus;
 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 {
 
index d50f485..743d394 100644 (file)
@@ -1,5 +1,10 @@
 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;
@@ -9,11 +14,6 @@ import org.openecomp.sdc.be.model.ComponentInstance;
 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";
index 298a445..3b1ed52 100644 (file)
@@ -1,6 +1,10 @@
 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;
@@ -16,10 +20,7 @@ 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 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 {
 
index be9f426..8071749 100644 (file)
@@ -1,6 +1,12 @@
 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;
@@ -15,12 +21,7 @@ import org.openecomp.sdc.be.model.CapabilityDefinition;
 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 {
index c75a6cc..bcdd08e 100644 (file)
@@ -1,5 +1,12 @@
 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;
@@ -8,13 +15,6 @@ import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
 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;
index 30801b0..26b6782 100644 (file)
@@ -1,6 +1,14 @@
 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;
@@ -14,14 +22,7 @@ import org.openecomp.sdc.be.model.InputDefinition;
 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 {
 
index 98fceab..d593e6f 100644 (file)
@@ -1,5 +1,13 @@
 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;
@@ -11,14 +19,6 @@ import org.openecomp.sdc.be.model.ComponentInstanceProperty;
 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";
index df3e0dd..be16bc3 100644 (file)
@@ -1,5 +1,10 @@
 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;
@@ -9,11 +14,6 @@ import org.openecomp.sdc.be.model.Component;
 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 {
 
index 4fbb1ab..70d4b87 100644 (file)
@@ -1,6 +1,11 @@
 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;
@@ -16,11 +21,7 @@ import org.openecomp.sdc.be.model.Service;
 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 {
index d73459c..adf1901 100644 (file)
@@ -1,7 +1,21 @@
 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;
@@ -31,21 +45,9 @@ import org.openecomp.sdc.common.api.ConfigurationSource;
 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 {
index 1158257..f5cd924 100644 (file)
@@ -1,6 +1,13 @@
 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;
@@ -19,13 +26,7 @@ import org.openecomp.sdc.be.model.User;
 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 {
 
index 630a43e..79064bc 100644 (file)
@@ -1,6 +1,13 @@
 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;
@@ -22,13 +29,7 @@ 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 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 {
 
index d946206..0efbf5f 100644 (file)
@@ -1,6 +1,16 @@
 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;
@@ -25,16 +35,7 @@ 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 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 {
 
index 08c8456..b341052 100644 (file)
@@ -1,6 +1,18 @@
 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;
@@ -26,18 +38,7 @@ 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 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 {
index 65ab3ec..972ea4e 100644 (file)
@@ -1,6 +1,15 @@
 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;
@@ -17,14 +26,7 @@ import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
 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 {
 
index bbb2dd6..bb1ea68 100644 (file)
@@ -1,6 +1,13 @@
 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;
@@ -17,13 +24,7 @@ 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 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 {
 
index 6013009..e5ca990 100644 (file)
@@ -1,6 +1,13 @@
 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;
@@ -15,13 +22,7 @@ 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 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 {
 
index 3b079d3..e310cad 100644 (file)
@@ -1,5 +1,11 @@
 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;
@@ -11,12 +17,6 @@ import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
 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";
index 5c23ec0..6faee48 100644 (file)
@@ -1,6 +1,17 @@
 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;
@@ -14,17 +25,7 @@ import org.openecomp.sdc.be.model.PropertyDefinition;
 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 {
 
index 0590c7e..a43e1e6 100644 (file)
@@ -1,5 +1,12 @@
 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;
@@ -11,13 +18,6 @@ import org.openecomp.sdc.be.components.utils.ObjectGenerator;
 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 {
 
index 3131c49..9d07be2 100644 (file)
@@ -1,6 +1,13 @@
 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;
@@ -15,13 +22,7 @@ import org.openecomp.sdc.be.model.Service;
 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 {
index 44f87bb..1182136 100644 (file)
@@ -1,7 +1,12 @@
 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;
@@ -35,12 +40,9 @@ import org.openecomp.sdc.common.util.ValidationUtils;
 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 {
 
index 0e56680..4b1dc80 100644 (file)
@@ -1,6 +1,10 @@
 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;
@@ -13,10 +17,7 @@ import org.openecomp.sdc.be.model.ComponentInstance;
 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;
index 03bbc31..7e797fe 100644 (file)
@@ -1,9 +1,14 @@
 
 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;
@@ -16,13 +21,10 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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")
index 5af94d7..4b36a98 100644 (file)
@@ -1,16 +1,16 @@
 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 {
 
 
index e5de493..f6edc45 100644 (file)
@@ -1,5 +1,14 @@
 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;
@@ -8,15 +17,6 @@ import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
 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;
index e7100a4..e92dd8d 100644 (file)
@@ -1,5 +1,19 @@
 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;
@@ -17,20 +31,6 @@ import org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil;
 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
index fd9e25f..daa342b 100644 (file)
@@ -1,8 +1,13 @@
 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;
@@ -18,12 +23,9 @@ 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 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 {
 
index 290ba07..6bbc2bc 100644 (file)
@@ -1,10 +1,10 @@
 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
index c4885e1..a56346c 100644 (file)
@@ -1,10 +1,10 @@
 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{
 
index 0d4b2f1..416f5d8 100644 (file)
@@ -1,13 +1,15 @@
 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() {
index 6a9731e..15673e2 100644 (file)
@@ -1,6 +1,11 @@
 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;
@@ -9,10 +14,7 @@ import org.openecomp.sdc.be.dao.cassandra.ComponentCassandraDao;
 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 {
index 2d7b1ad..29b8484 100644 (file)
@@ -1,10 +1,10 @@
 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
index 09e1a72..c4cf9fc 100644 (file)
@@ -1,12 +1,13 @@
 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";
index 1aa3ab8..effc358 100644 (file)
@@ -1,11 +1,12 @@
 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
index 4e3923d..cb8f3b9 100644 (file)
@@ -1,6 +1,20 @@
 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;
@@ -16,19 +30,8 @@ import com.thinkaurelius.titan.core.util.TitanCleanup;
 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 {
index 4e0105f..62d909c 100644 (file)
@@ -1,10 +1,10 @@
 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 {
 
index 7a7eff8..9c41ff9 100644 (file)
@@ -1,11 +1,9 @@
 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;
@@ -21,9 +19,12 @@ import org.openecomp.sdc.be.resources.data.UserData;
 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 {
 
index 79a1dab..1ae0898 100644 (file)
 
 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;
@@ -32,13 +37,10 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
 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 {
 
index 9bd04d6..193f5d9 100644 (file)
@@ -1,6 +1,17 @@
 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;
@@ -26,17 +37,7 @@ import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
 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)
index cd454d5..5802995 100644 (file)
@@ -1,6 +1,16 @@
 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;
@@ -21,16 +31,7 @@ import org.openecomp.sdc.be.model.jsontitan.operations.PolicyOperation;
 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)
index 0c761a9..d6018f2 100644 (file)
@@ -1,5 +1,12 @@
 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;
@@ -8,13 +15,6 @@ import org.openecomp.sdc.be.model.ComponentInstancePropInput;
 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";
index 56aef5d..e22bfd9 100644 (file)
@@ -1,6 +1,18 @@
 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;
@@ -16,18 +28,7 @@ import org.openecomp.sdc.be.datatypes.enums.EnvironmentStatusEnum;
 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 {
 
index 32e3f9c..55a119e 100644 (file)
@@ -1,10 +1,10 @@
 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;
index 4c13755..6a54562 100644 (file)
@@ -1,10 +1,10 @@
 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;
index 490140d..f3cf208 100644 (file)
@@ -1,5 +1,9 @@
 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;
@@ -12,10 +16,6 @@ import org.openecomp.sdc.be.model.LifecycleStateEnum;
 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;
index f461806..864fb19 100644 (file)
@@ -1,13 +1,13 @@
 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;
index d7deaa4..08ed89f 100644 (file)
@@ -1,10 +1,10 @@
 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;
 
index 249cf69..3a99d54 100644 (file)
@@ -1,5 +1,11 @@
 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;
@@ -9,12 +15,6 @@ import org.openecomp.sdc.be.model.PropertyDefinition;
 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) {
index b6aa96e..0e35964 100644 (file)
@@ -1,10 +1,10 @@
 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;
index f818c04..2826e20 100644 (file)
@@ -1,15 +1,15 @@
 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;
index 8c2b54f..d084bc2 100644 (file)
@@ -1,12 +1,12 @@
 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;
index 9d5d71d..94ad42c 100644 (file)
@@ -1,11 +1,11 @@
 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;
index 85b2228..2f4ac9a 100644 (file)
@@ -1,10 +1,10 @@
 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() {
index e0d35c6..6c968f2 100644 (file)
@@ -1,12 +1,12 @@
 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;
index 25468af..e5a1485 100644 (file)
@@ -1,10 +1,10 @@
 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;
index be19e8b..4a12372 100644 (file)
@@ -1,12 +1,12 @@
 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 {
 
index 7e8d1b2..a8686c1 100644 (file)
 
 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;
@@ -39,13 +45,9 @@ 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 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 {
 
index df48a53..8538e09 100644 (file)
@@ -1,6 +1,11 @@
 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;
@@ -22,11 +27,7 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
 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 {
 
index 4f90a0a..48aff66 100644 (file)
@@ -1,5 +1,9 @@
 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;
@@ -11,10 +15,6 @@ import org.openecomp.sdc.be.model.Resource;
 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;
index a80999a..42b730b 100644 (file)
 
 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;
@@ -38,14 +46,6 @@ 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 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
index 4257a88..07ca012 100644 (file)
 
 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;
@@ -30,14 +38,6 @@ import org.openecomp.sdc.be.model.Service;
 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
index 29b43c1..64f66ea 100644 (file)
 
 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;
@@ -40,6 +35,12 @@ import java.util.concurrent.ThreadPoolExecutor;
 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) {
index 253fd31..7a74a1f 100644 (file)
 
 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;
@@ -48,16 +57,8 @@ import org.springframework.context.ApplicationContext;
 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 {
 
index 8a40e83..f0ec613 100644 (file)
 
 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 {
 
index fa43523..04dbf0a 100644 (file)
 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;
@@ -55,17 +67,7 @@ import org.springframework.context.ApplicationContext;
 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 {
 
index 52e9230..7871dd9 100644 (file)
@@ -1,15 +1,9 @@
 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;
@@ -25,7 +19,6 @@ import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
 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;
@@ -33,17 +26,14 @@ import org.openecomp.sdc.be.model.Resource;
 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 {
 
index be43fa7..99053aa 100644 (file)
 
 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;
@@ -40,8 +32,18 @@ import java.nio.file.Paths;
 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() {};
index 6fe303b..d7d4704 100644 (file)
 
 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() {
index 218505d..8378a71 100644 (file)
@@ -1,11 +1,11 @@
 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
index c723e0e..5d85f52 100644 (file)
@@ -1,6 +1,15 @@
 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;
@@ -23,15 +32,7 @@ import org.springframework.context.ApplicationContext;
 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
index 2d54943..39a541d 100644 (file)
@@ -1,9 +1,24 @@
 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;
@@ -33,23 +48,11 @@ import org.springframework.context.annotation.Configuration;
 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 {
 
index 9a074c9..c7e759d 100644 (file)
@@ -1,5 +1,9 @@
 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;
@@ -8,10 +12,6 @@ import org.junit.BeforeClass;
 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;
index bb94925..41e2abe 100644 (file)
@@ -1,7 +1,25 @@
 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;
@@ -25,24 +43,9 @@ import org.openecomp.sdc.be.model.PropertyDefinition;
 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{
 
index 23f32d1..b58cae5 100644 (file)
@@ -1,7 +1,17 @@
 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;
@@ -15,16 +25,9 @@ import org.openecomp.sdc.be.model.PolicyTypeDefinition;
 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 {
 
index 63e7670..f64dfb9 100644 (file)
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertNotNull;
 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;
index e8aeb5f..5a35793 100644 (file)
 
 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;
@@ -55,17 +65,10 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
 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);
index 23daab9..8d9b95d 100644 (file)
 
 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;
@@ -51,20 +66,7 @@ import org.springframework.context.ApplicationContext;
 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);
index 690f742..cfa65f7 100644 (file)
 
 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;
@@ -53,18 +66,7 @@ import org.springframework.context.ApplicationContext;
 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 {
 
index 696214f..3e6f934 100644 (file)
 
 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;
@@ -41,16 +50,9 @@ import org.openecomp.sdc.exception.ResponseFormat;
 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 {
 
index 3c42257..b00bd0f 100644 (file)
@@ -1,13 +1,9 @@
 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;
@@ -17,9 +13,13 @@ import java.util.List;
 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 {
 
index 8883786..5ac1467 100644 (file)
 
 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;
@@ -29,12 +35,7 @@ import org.openecomp.sdc.common.api.ConfigurationSource;
 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
index dbdec12..139de13 100644 (file)
@@ -1,6 +1,18 @@
 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;
@@ -11,18 +23,7 @@ import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
 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;
index 839095f..05f872f 100644 (file)
@@ -20,8 +20,8 @@
 
 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;
@@ -31,8 +31,8 @@ import java.nio.file.Paths;
 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 {
 
index efc89a9..041973a 100644 (file)
@@ -1,7 +1,5 @@
 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;
@@ -9,6 +7,9 @@ import org.slf4j.Logger;
 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
index dc964be..338143e 100644 (file)
@@ -19,6 +19,7 @@ import static org.junit.Assert.assertEquals;
 
 import java.io.File;
 import java.util.HashMap;
+
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.openecomp.sdc.be.DummyConfigurationManager;
index 8d45e42..0a65a51 100644 (file)
 
 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;
@@ -46,11 +51,7 @@ import org.openecomp.sdc.common.transaction.api.TransactionUtils.TransactionCode
 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);
index 95c2ac7..0fbf2c8 100644 (file)
@@ -1,10 +1,11 @@
 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")
 
diff --git a/catalog-be/src/test/resources/config/mock.txt b/catalog-be/src/test/resources/config/mock.txt
new file mode 100644 (file)
index 0000000..e69de29
index b485e46..3d0c8a1 100644 (file)
@@ -2,18 +2,14 @@ package org.openecomp.sdc.be.model;
 
 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 {