summaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/pom.xml2852
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java12
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/path/ComponentInstanceForwardingPathMergeTest.java51
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathTest.java72
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathVersionChangeTest.java37
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathBusinessLogicTest.java68
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathChangeVersionTest.java2
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathDeleteCITest.java6
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathRenameNodeTest.java2
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathToscaUtilTest.java210
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathValidatorTest.java98
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtilTest.java196
-rw-r--r--catalog-be/src/test/resources/paths/path-context.xml112
13 files changed, 1844 insertions, 1874 deletions
diff --git a/catalog-be/pom.xml b/catalog-be/pom.xml
index e3988433a5..97cd8b6df0 100644
--- a/catalog-be/pom.xml
+++ b/catalog-be/pom.xml
@@ -1,1431 +1,1439 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>catalog-be</artifactId>
- <packaging>war</packaging>
-
- <parent>
- <groupId>org.openecomp.sdc</groupId>
- <artifactId>sdc-main</artifactId>
- <version>1.10.0-SNAPSHOT</version>
- </parent>
-
- <properties>
- <java-hamcrest.version>2.0.0.0</java-hamcrest.version>
- <swagger.version>${swagger-core-mvn-plugin.version}</swagger.version>
- <swagger-ui.version>3.25.0</swagger-ui.version>
- <maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version>
- <replacer.plugin.version>1.5.3</replacer.plugin.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.openecomp.sdc</groupId>
- <artifactId>togglz-rest-services</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.woodstox</groupId>
- <artifactId>woodstox-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!--JSON and YAML Parsing-->
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-yaml</artifactId>
- <version>${jackson.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.onap.sdc.common</groupId>
- <artifactId>onap-generic-artifact-browser-service</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Swagger Dependencies Start -->
- <dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-jaxrs2</artifactId>
- <version>${swagger.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-annotations</artifactId>
- <version>${swagger.version}</version>
- </dependency>
- <!-- Swagger Dependencies End -->
-
- <dependency>
- <groupId>org.hibernate.validator</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>${hibernate.validator.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.sdc</groupId>
- <artifactId>common-app-api</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>${ws.rs.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.sdc.be</groupId>
- <artifactId>common-be</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.openecomp.sdc.be</groupId>
- <artifactId>common-be</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.openecomp.sdc.be</groupId>
- <artifactId>catalog-dao</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.sdc.be</groupId>
- <artifactId>catalog-model</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>${logback.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Snake Yaml -->
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>${snakeyaml.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- File changes listener -->
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-jci-core</artifactId>
- <version>${commons-jci-core.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Gson -->
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- jersey -->
- <dependency>
- <groupId>org.glassfish.jersey.media</groupId>
- <artifactId>jersey-media-json-jackson</artifactId>
- <version>${jersey-bom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.jersey.containers</groupId>
- <artifactId>jersey-container-servlet-core</artifactId>
- <version>${jersey-bom.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.jersey.media</groupId>
- <artifactId>jersey-media-multipart</artifactId>
- <version>${jersey-bom.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.ext</groupId>
- <artifactId>jersey-spring4</artifactId>
- <version>${jersey-bom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- </exclusion>
- <!-- Transitive dependency of spring-bridge -->
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- </exclusion>
- </exclusions>
-
- </dependency>
-
- <!--asm-all-repackaged is a jersey dependency. in current version jersey depends on a version that was compiled using java 9 compiler
- currently our jetty (v9.3.6) does not support java 9. as soon as jetty gets upgraded we will remove this dependency-->
- <dependency>
- <groupId>org.glassfish.hk2.external</groupId>
- <artifactId>asm-all-repackaged</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.jersey.ext</groupId>
- <artifactId>jersey-bean-validation</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- http client -->
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpclient.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>${httpcore.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons-logging}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons-codec}</version>
- <scope>compile</scope>
- </dependency>
- <!-- http client END -->
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>${servlet-api.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jgit</groupId>
- <artifactId>org.eclipse.jgit</artifactId>
- <version>3.4.1.201406201815-r</version>
- </dependency>
-
- <!-- spring - used by A4C -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${spring.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${spring.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- <version>${spring.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>${spring.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- <version>${spring.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Spring integration (optional) -->
- <dependency>
- <groupId>org.togglz</groupId>
- <artifactId>togglz-spring-web</artifactId>
- <version>${togglz.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.janino</groupId>
- <artifactId>janino</artifactId>
- <version>${janino.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.janino</groupId>
- <artifactId>commons-compiler</artifactId>
- <version>${janino.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.janusgraph</groupId>
- <artifactId>janusgraph-core</artifactId>
- <version>${janusgraph.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <artifactId>gremlin-groovy</artifactId>
- <groupId>org.apache.tinkerpop</groupId>
- </exclusion>
- <exclusion>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>slf4j-log4j12</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- <exclusion>
- <artifactId>commons-collections</artifactId>
- <groupId>commons-collections</groupId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.thrift</groupId>
- <artifactId>libthrift</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.janusgraph</groupId>
- <artifactId>janusgraph-cql</artifactId>
- <version>${janusgraph.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>commons-collections</artifactId>
- <groupId>commons-collections</groupId>
- </exclusion>
- <exclusion>
- <artifactId>groovy</artifactId>
- <groupId>org.codehaus.groovy</groupId>
- </exclusion>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${lang3.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>${json-simple.version}</version>
- <scope>compile</scope>
-
- </dependency>
-
- <!-- functional java -->
- <dependency>
- <groupId>org.functionaljava</groupId>
- <artifactId>functionaljava</artifactId>
- <version>${functionaljava.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Aspects -->
- <dependency>
- <groupId>com.jcabi</groupId>
- <artifactId>jcabi-aspects</artifactId>
- <version>${jcabi.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>${aspectjrt.version}</version>
- <scope>compile</scope>
- </dependency>
-
-
- <!-- CAMBRIA CLIENT for U-EB -->
- <dependency>
- <groupId>com.att.nsa</groupId>
- <artifactId>cambriaClient</artifactId>
- <version>1.2.1-oss</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>com.att.nsa</groupId>
- <artifactId>saClientLibrary</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20131018</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- CASSANDRA -->
- <dependency>
- <groupId>com.datastax.cassandra</groupId>
- <artifactId>cassandra-driver-core</artifactId>
- <version>${cassandra.driver.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.datastax.cassandra</groupId>
- <artifactId>cassandra-driver-mapping</artifactId>
- <version>${cassandra.driver.version}</version>
- <scope>compile</scope>
- </dependency>
- <!-- CASSANDRA END -->
-
- <!-- Inserted for ECOMP Portal Integration -->
- <dependency>
- <groupId>org.owasp.esapi</groupId>
- <artifactId>esapi</artifactId>
- <version>${org.owasp.esapi.version}</version>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>xmlgraphics-commons</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.onap.portal.sdk</groupId>
- <artifactId>epsdk-fw</artifactId>
- <version>${ecomp.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>com.att.nsa</groupId>
- <artifactId>cambriaClient</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>slf4j-log4j12</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- <exclusion>
- <groupId>org.onap.aaf.authz</groupId>
- <artifactId>aaf-cadi-aaf</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>aaf-cadi-core</artifactId>
- <groupId>org.onap.aaf.authz</groupId>
- </exclusion>
- <exclusion>
- <artifactId>commons-codec</artifactId>
- <groupId>commons-codec</groupId>
- </exclusion>
- <exclusion>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!--Jetty Proxy-->
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-http</artifactId>
- <version>${jetty.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-proxy</artifactId>
- <version>${jetty.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-http</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlets</artifactId>
- <version>${jetty.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-http</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-continuation</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- System metrics -->
- <dependency>
- <groupId>org.fusesource</groupId>
- <artifactId>sigar</artifactId>
- <version>${sigar.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.onap.dmaap.messagerouter.dmaapclient</groupId>
- <artifactId>dmaapClient</artifactId>
- <version>1.1.3</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>com.att.aft</groupId>
- <artifactId>dme2</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- </exclusion>
- <exclusion>
- <artifactId>apache-log4j-extras</artifactId>
- <groupId>log4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.att.aft</groupId>
- <artifactId>dme2</artifactId>
- <version>3.1.200-oss</version>
- <exclusions>
- <exclusion>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- CADI -->
- <dependency>
- <groupId>org.onap.aaf.authz</groupId>
- <artifactId>aaf-cadi-aaf</artifactId>
- <version>${cadi.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.datastax.cassandra</groupId>
- <artifactId>cassandra-driver-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- TEST -->
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.jersey.test-framework.providers</groupId>
- <artifactId>jersey-test-framework-provider-bundle</artifactId>
- <version>${jersey-bom.version}</version>
- <type>pom</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-continuation</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${jersey-bom.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest</artifactId>
- <version>${hamcrest.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- <version>${hamcrest.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-api</artifactId>
- <version>${junitJupiter.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <version>${junitJupiter.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.junit.platform</groupId>
- <artifactId>junit-platform-commons</artifactId>
- <version>${junit.platform.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.platform</groupId>
- <artifactId>junit-platform-engine</artifactId>
- <version>${junit.platform.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-junit-jupiter</artifactId>
- <version>${mockitoJupiter.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${spring.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>io.cucumber</groupId>
- <artifactId>cucumber-java</artifactId>
- <version>${cucumber.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>io.cucumber</groupId>
- <artifactId>cucumber-junit</artifactId>
- <version>${cucumber.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jmockit</groupId>
- <artifactId>jmockit</artifactId>
- <version>${jmockit.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.code.bean-matchers</groupId>
- <artifactId>bean-matchers</artifactId>
- <version>0.11</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy</artifactId>
- <version>${groovy.version}</version>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-handler</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onap.sdc.common</groupId>
- <artifactId>onap-tosca-datatype</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- <version>${commons.collections.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.sdc.sdc-be-common</groupId>
- <artifactId>security-util-lib</artifactId>
- <version>${security.util.lib.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.openecomp.sdc.core</groupId>
- <artifactId>openecomp-tosca-lib</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.onap.vnfsdk.validation</groupId>
- <artifactId>validation-pmdictionary</artifactId>
- <version>${onap.vnfsdk.validation.pmdictionary.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.jmapper-framework</groupId>
- <artifactId>jmapper-core</artifactId>
- <version>${jMapper.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.thoughtworks.xstream</groupId>
- <artifactId>xstream</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>catalog-be</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkCount>1C</forkCount>
- <reuseForks>false</reuseForks>
- </configuration>
- </plugin>
- <plugin>
- <!-- Download Swagger UI webjar. -->
- <artifactId>maven-dependency-plugin</artifactId>
- <version>${maven-dependency-plugin.version}</version>
- <executions>
- <execution>
- <phase>prepare-package</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.webjars</groupId>
- <artifactId>swagger-ui</artifactId>
- <version>${swagger-ui.version}</version>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/swagger-ui</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <!-- Replace the OpenAPI specification example URL with the local one. -->
- <groupId>com.google.code.maven-replacer-plugin</groupId>
- <artifactId>replacer</artifactId>
- <version>${replacer.plugin.version}</version>
- <executions>
- <execution>
- <phase>prepare-package</phase>
- <goals>
- <goal>replace</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <file>
- ${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}/index.html
- </file>
- <replacements>
- <replacement>
- <token>https://petstore.swagger.io/v2/swagger.json</token>
- <value>/sdc/openapi.json</value>
- </replacement>
- </replacements>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <packagingExcludes>WEB-INF\lib\slf4j-log4j*.jar,
- WEB-INF/classes/elasticsearch.yml,
- WEB-INF/classes/portal.properties
- </packagingExcludes>
- <archive>
- <manifestEntries>
- <SDC-Version>${project.version}</SDC-Version>
- </manifestEntries>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
- </manifest>
- </archive>
- <attachClasses>true</attachClasses>
- <webResources combine.children="append">
- <resource>
- <directory>
- ${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}
- </directory>
- <includes>
- <include>**/*.*</include>
- </includes>
- <targetPath>swagger-ui</targetPath>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>com.github.sylvainlaurent.maven</groupId>
- <artifactId>yaml-json-validator-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>validate</id>
- <phase>validate</phase>
- <goals>
- <goal>validate</goal>
- </goals>
- <configuration>
- <validationSets>
- <validationSet>
- <includes>
- <include>src/main/resources/**/*.y*ml</include>
- <include>src/test/resources/**/*.y*ml</include>
- </includes>
- <excludes>
- <exclude>
- src/test/resources/artifacts/pnfSoftwareInformation/**
- </exclude>
- </excludes>
- </validationSet>
- <validationSet>
- <includes>
- <include>src/main/resources/**/*.json</include>
- <include>src/test/resources/**/*.json</include>
- </includes>
- </validationSet>
- </validationSets>
- <skip>${skipYamlJsonValidator}</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.jcabi</groupId>
- <artifactId>jcabi-maven-plugin</artifactId>
- <version>${jcabi.maven.plugin.version}</version>
- <dependencies>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjtools</artifactId>
- <version>${aspectj.version}</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>${aspectj.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <goals>
- <goal>ajc</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>normatives</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <finalName>normatives</finalName>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>src/main/assembly/normatives.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <executions>
- <execution>
- <id>clean.sdc.backend.folder</id>
- <phase>clean</phase>
- <goals>
- <goal>clean</goal>
- </goals>
- <configuration>
- <filesets>
- <fileset>
- <directory>
- sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/files/default
- </directory>
- <followSymlinks>false</followSymlinks>
- <includes>
- <include>normatives.tar.gz</include>
- </includes>
- </fileset>
- </filesets>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-maven-plugin</artifactId>
- <version>${swagger-core-mvn-plugin.version}</version>
- <executions>
- <execution>
- <id>sdce-2-sdce-5</id>
- <phase>compile</phase>
- <goals>
- <goal>resolve</goal>
- </goals>
- <configuration>
- <contextId>sdce-2-sdce-5</contextId>
- <outputPath>${project.build.directory}/generated/swagger</outputPath>
- <outputFileName>swagger-sdce-2-sdce-5</outputFileName>
- <outputFormat>JSON</outputFormat>
- <configurationFilePath>
- ${project.basedir}/src/main/resources/swagger-config/sdce-2-sdce-5.yaml
- </configurationFilePath>
- <skip>${swagger.skip}</skip>
- </configuration>
- </execution>
- <execution>
- <id>sdce-4</id>
- <phase>compile</phase>
- <goals>
- <goal>resolve</goal>
- </goals>
- <configuration>
- <contextId>sdce-4</contextId>
- <outputPath>${project.build.directory}/generated/swagger</outputPath>
- <outputFileName>swagger-sdce-4</outputFileName>
- <outputFormat>JSON</outputFormat>
- <configurationFilePath>
- ${project.basedir}/src/main/resources/swagger-config/sdce-4.yaml
- </configurationFilePath>
- <skip>${swagger.skip}</skip>
- </configuration>
- </execution>
- <execution>
- <id>sdce-6</id>
- <phase>compile</phase>
- <goals>
- <goal>resolve</goal>
- </goals>
- <configuration>
- <contextId>sdce-6</contextId>
- <outputPath>${project.build.directory}/generated/swagger</outputPath>
- <outputFileName>swagger-sdce-6</outputFileName>
- <outputFormat>JSON</outputFormat>
- <configurationFilePath>
- ${project.basedir}/src/main/resources/swagger-config/sdce-6.yaml
- </configurationFilePath>
- <skip>${swagger.skip}</skip>
- </configuration>
- </execution>
- <execution>
- <id>sdce-7</id>
- <phase>compile</phase>
- <goals>
- <goal>resolve</goal>
- </goals>
- <configuration>
- <contextId>sdce-7</contextId>
- <outputPath>${project.build.directory}/generated/swagger</outputPath>
- <outputFileName>swagger-sdce-7</outputFileName>
- <outputFormat>JSON</outputFormat>
- <configurationFilePath>
- ${project.basedir}/src/main/resources/swagger-config/sdce-7.yaml
- </configurationFilePath>
- <skip>${swagger.skip}</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
- only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>com.googlecode.maven-download-plugin</groupId>
- <artifactId>download-maven-plugin</artifactId>
- <versionRange>[1.2.1,)</versionRange>
- <goals>
- <goal>wget</goal>
- </goals>
- </pluginExecutionFilter>
- </pluginExecution>
-
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>com.jcabi</groupId>
- <artifactId>jcabi-maven-plugin</artifactId>
- <versionRange>[0.0,)</versionRange>
- <goals>
- <goal>ajc</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <execute/>
- </action>
- </pluginExecution>
-
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <!-- Swagger Plugins End -->
- </build>
-
- <profiles>
- <profile>
- <id>docker</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <artifactId>catalog-be</artifactId>
+
+ <build>
+ <finalName>catalog-be</finalName>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <artifactId>lifecycle-mapping</artifactId>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <artifactId>download-maven-plugin</artifactId>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <versionRange>[1.2.1,)</versionRange>
+ </pluginExecutionFilter>
+ </pluginExecution>
+
+ <pluginExecution>
+ <action>
+ <execute/>
+ </action>
+ <pluginExecutionFilter>
+ <artifactId>jcabi-maven-plugin</artifactId>
+ <goals>
+ <goal>ajc</goal>
+ </goals>
+ <groupId>com.jcabi</groupId>
+ <versionRange>[0.0,)</versionRange>
+ </pluginExecutionFilter>
+ </pluginExecution>
+
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ <groupId>org.eclipse.m2e</groupId>
+ <version>1.0.0</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-normatives</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <outputDirectory>
- sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/files/default
- </outputDirectory>
- <resources>
- <resource>
- <directory>${project.build.directory}</directory>
- <includes>
- <include>normatives.tar.gz</include>
- </includes>
- </resource>
- </resources>
+ <forkCount>1C</forkCount>
+ <reuseForks>false</reuseForks>
</configuration>
- </execution>
- <execution>
- <id>copy-sdc-be-py</id>
- <phase>verify</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
+ <groupId>org.apache.maven.plugins</groupId>
+ </plugin>
+ <plugin>
+ <!-- Download Swagger UI webjar. -->
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <artifactId>swagger-ui</artifactId>
+ <groupId>org.webjars</groupId>
+ <version>${swagger-ui.version}</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/swagger-ui</outputDirectory>
+ </configuration>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ </execution>
+ </executions>
+ <version>${maven-dependency-plugin.version}</version>
+ </plugin>
+ <plugin>
+ <!-- Replace the OpenAPI specification example URL with the local one. -->
+ <artifactId>replacer</artifactId>
<configuration>
- <outputDirectory>
- sdc-backend-init/
- </outputDirectory>
- <resources>
- <resource>
- <directory>
- ${project.parent.basedir}/catalog-be/src/main/resources/
- </directory>
- <includes>
- <include>scripts/sdcBePy/**</include>
- <inculde>scripts/setup.py</inculde>
- </includes>
- </resource>
- </resources>
+ <file>
+ ${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}/index.html
+ </file>
+ <replacements>
+ <replacement>
+ <token>https://petstore.swagger.io/v2/swagger.json</token>
+ <value>/sdc/openapi.json</value>
+ </replacement>
+ </replacements>
</configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>io.fabric8</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <configuration>
- <verbose>${verbose}</verbose>
- <apiVersion>${docker.api.version}</apiVersion>
- <registry>nexus3.onap.org:10001</registry>
- <authConfig>
- <pull>
- <username>docker</username>
- <password>docker</password>
- </pull>
- </authConfig>
- <images>
-
- <!-- Build backend image -->
- <image>
- <name>onap/sdc-backend</name>
- <alias>sdc-backend</alias>
- <build>
- <cleanup>try</cleanup>
- <dockerFileDir>backend</dockerFileDir>
- <tags>
- <tag>latest</tag>
- <tag>
- ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest
- </tag>
- <tag>
- ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-${maven.build.timestamp}
- </tag>
- </tags>
- <assembly>
- <descriptor>backend/backend-files.xml</descriptor>
- <name>onap-sdc-backend</name>
- </assembly>
- </build>
- </image>
- <!-- Build backend-init image -->
- <image>
- <name>onap/sdc-backend-init</name>
- <alias>sdc-backend-init</alias>
- <build>
- <cleanup>try</cleanup>
- <dockerFileDir>${project.basedir}/sdc-backend-init
- </dockerFileDir>
- <tags>
- <tag>latest</tag>
- <tag>
- ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest
- </tag>
- <tag>
- ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-${maven.build.timestamp}
- </tag>
- </tags>
- </build>
- </image>
- </images>
- </configuration>
- <executions>
- <execution>
- <id>clean-images</id>
- <phase>pre-clean</phase>
- <goals>
- <goal>remove</goal>
- </goals>
+ <executions>
+ <execution>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ </execution>
+ </executions>
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <version>${replacer.plugin.version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
<configuration>
- <removeAll>true</removeAll>
- <image>onap/sdc-backend,onap/sdc-backend-init</image>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ </manifest>
+ <manifestEntries>
+ <SDC-Version>${project.version}</SDC-Version>
+ </manifestEntries>
+ </archive>
+ <attachClasses>true</attachClasses>
+ <packagingExcludes>WEB-INF\lib\slf4j-log4j*.jar,
+ WEB-INF/classes/elasticsearch.yml,
+ WEB-INF/classes/portal.properties
+ </packagingExcludes>
+ <webResources combine.children="append">
+ <resource>
+ <directory>
+ ${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}
+ </directory>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ <targetPath>swagger-ui</targetPath>
+ </resource>
+ </webResources>
</configuration>
- </execution>
-
- <execution>
- <id>generate-images</id>
- <phase>install</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
-
- <execution>
- <id>push-images</id>
- <phase>deploy</phase>
- <goals>
- <goal>push</goal>
- </goals>
- <configuration>
- <image>onap/sdc-backend,onap/sdc-backend-init</image>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ </plugin>
+ <plugin>
+ <artifactId>yaml-json-validator-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <skip>${skipYamlJsonValidator}</skip>
+ <validationSets>
+ <validationSet>
+ <excludes>
+ <exclude>
+ src/test/resources/artifacts/pnfSoftwareInformation/**
+ </exclude>
+ </excludes>
+ <includes>
+ <include>src/main/resources/**/*.y*ml</include>
+ <include>src/test/resources/**/*.y*ml</include>
+ </includes>
+ </validationSet>
+ <validationSet>
+ <includes>
+ <include>src/main/resources/**/*.json</include>
+ <include>src/test/resources/**/*.json</include>
+ </includes>
+ </validationSet>
+ </validationSets>
+ </configuration>
+ <goals>
+ <goal>validate</goal>
+ </goals>
+ <id>validate</id>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ <groupId>com.github.sylvainlaurent.maven</groupId>
+ </plugin>
+ <plugin>
+ <artifactId>jcabi-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <artifactId>aspectjtools</artifactId>
+ <groupId>org.aspectj</groupId>
+ <version>${aspectj.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>aspectjweaver</artifactId>
+ <groupId>org.aspectj</groupId>
+ <version>${aspectj.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <goals>
+ <goal>ajc</goal>
+ </goals>
+ </execution>
+ </executions>
+ <groupId>com.jcabi</groupId>
+ <version>${jcabi.maven.plugin.version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/main/assembly/normatives.xml</descriptor>
+ </descriptors>
+ <finalName>normatives</finalName>
+ </configuration>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <id>normatives</id>
+ <phase>prepare-package</phase>
+ </execution>
+ </executions>
+ <groupId>org.apache.maven.plugins</groupId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>
+ sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/files/default
+ </directory>
+ <followSymlinks>false</followSymlinks>
+ <includes>
+ <include>normatives.tar.gz</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <id>clean.sdc.backend.folder</id>
+ <phase>clean</phase>
+ </execution>
+ </executions>
+ <groupId>org.apache.maven.plugins</groupId>
+ </plugin>
+ <plugin>
+ <artifactId>swagger-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <configurationFilePath>
+ ${project.basedir}/src/main/resources/swagger-config/sdce-2-sdce-5.yaml
+ </configurationFilePath>
+ <contextId>sdce-2-sdce-5</contextId>
+ <outputFileName>swagger-sdce-2-sdce-5</outputFileName>
+ <outputFormat>JSON</outputFormat>
+ <outputPath>${project.build.directory}/generated/swagger</outputPath>
+ <skip>${swagger.skip}</skip>
+ </configuration>
+ <goals>
+ <goal>resolve</goal>
+ </goals>
+ <id>sdce-2-sdce-5</id>
+ <phase>compile</phase>
+ </execution>
+ <execution>
+ <configuration>
+ <configurationFilePath>
+ ${project.basedir}/src/main/resources/swagger-config/sdce-4.yaml
+ </configurationFilePath>
+ <contextId>sdce-4</contextId>
+ <outputFileName>swagger-sdce-4</outputFileName>
+ <outputFormat>JSON</outputFormat>
+ <outputPath>${project.build.directory}/generated/swagger</outputPath>
+ <skip>${swagger.skip}</skip>
+ </configuration>
+ <goals>
+ <goal>resolve</goal>
+ </goals>
+ <id>sdce-4</id>
+ <phase>compile</phase>
+ </execution>
+ <execution>
+ <configuration>
+ <configurationFilePath>
+ ${project.basedir}/src/main/resources/swagger-config/sdce-6.yaml
+ </configurationFilePath>
+ <contextId>sdce-6</contextId>
+ <outputFileName>swagger-sdce-6</outputFileName>
+ <outputFormat>JSON</outputFormat>
+ <outputPath>${project.build.directory}/generated/swagger</outputPath>
+ <skip>${swagger.skip}</skip>
+ </configuration>
+ <goals>
+ <goal>resolve</goal>
+ </goals>
+ <id>sdce-6</id>
+ <phase>compile</phase>
+ </execution>
+ <execution>
+ <configuration>
+ <configurationFilePath>
+ ${project.basedir}/src/main/resources/swagger-config/sdce-7.yaml
+ </configurationFilePath>
+ <contextId>sdce-7</contextId>
+ <outputFileName>swagger-sdce-7</outputFileName>
+ <outputFormat>JSON</outputFormat>
+ <outputPath>${project.build.directory}/generated/swagger</outputPath>
+ <skip>${swagger.skip}</skip>
+ </configuration>
+ <goals>
+ <goal>resolve</goal>
+ </goals>
+ <id>sdce-7</id>
+ <phase>compile</phase>
+ </execution>
+ </executions>
+ <groupId>io.swagger.core.v3</groupId>
+ <version>${swagger-core-mvn-plugin.version}</version>
+ </plugin>
</plugins>
- </build>
- </profile>
- </profiles>
+ <!-- Swagger Plugins End -->
+ </build>
+ <dependencies>
+ <dependency>
+ <artifactId>togglz-rest-services</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>woodstox-core</artifactId>
+ <groupId>com.fasterxml.woodstox</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!--JSON and YAML Parsing-->
+ <dependency>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>jackson-dataformat-yaml</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <version>${jackson.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jackson-databind</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <version>${jackson.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>onap-generic-artifact-browser-service</artifactId>
+ <groupId>org.onap.sdc.common</groupId>
+ <scope>compile</scope>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- Swagger Dependencies Start -->
+ <dependency>
+ <artifactId>swagger-jaxrs2</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>io.swagger.core.v3</groupId>
+ <version>${swagger.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>swagger-annotations</artifactId>
+ <groupId>io.swagger.core.v3</groupId>
+ <version>${swagger.version}</version>
+ </dependency>
+ <!-- Swagger Dependencies End -->
+
+ <dependency>
+ <artifactId>hibernate-validator</artifactId>
+ <groupId>org.hibernate.validator</groupId>
+ <version>${hibernate.validator.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>common-app-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <groupId>javax.ws.rs</groupId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>common-be</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.openecomp.sdc.be</groupId>
+ <scope>compile</scope>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>common-be</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.openecomp.sdc.be</groupId>
+ <scope>test</scope>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>catalog-dao</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.openecomp.sdc.be</groupId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>catalog-model</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.openecomp.sdc.be</groupId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>logback-classic</artifactId>
+ <groupId>ch.qos.logback</groupId>
+ <scope>compile</scope>
+ <version>${logback.version}</version>
+ </dependency>
+
+ <!-- Snake Yaml -->
+ <dependency>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ <scope>compile</scope>
+ <version>${snakeyaml.version}</version>
+ </dependency>
+
+ <!-- File changes listener -->
+ <dependency>
+ <artifactId>commons-jci-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-io</artifactId>
+ <groupId>commons-io</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.apache.commons</groupId>
+ <scope>compile</scope>
+ <version>${commons-jci-core.version}</version>
+ </dependency>
+
+ <!-- Gson -->
+ <dependency>
+ <artifactId>gson</artifactId>
+ <groupId>com.google.code.gson</groupId>
+ <scope>compile</scope>
+ <version>${gson.version}</version>
+ </dependency>
+
+ <!-- jersey -->
+ <dependency>
+ <artifactId>jersey-media-json-jackson</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <version>${jersey-bom.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jersey-container-servlet-core</artifactId>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <scope>compile</scope>
+ <version>${jersey-bom.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jersey-media-multipart</artifactId>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <scope>compile</scope>
+ <version>${jersey-bom.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>jersey-spring4</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-web</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-beans</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-aop</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <!-- Transitive dependency of spring-bridge -->
+ <exclusion>
+ <artifactId>spring-context</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>hibernate-validator</artifactId>
+ <groupId>org.hibernate</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.glassfish.jersey.ext</groupId>
+ <version>${jersey-bom.version}</version>
+
+ </dependency>
+
+ <!--asm-all-repackaged is a jersey dependency. in current version jersey depends on a version that was compiled using java 9 compiler
+ currently our jetty (v9.3.6) does not support java 9. as soon as jetty gets upgraded we will remove this dependency-->
+ <dependency>
+ <artifactId>asm-all-repackaged</artifactId>
+ <groupId>org.glassfish.hk2.external</groupId>
+ </dependency>
+
+ <dependency>
+ <artifactId>jersey-bean-validation</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>hibernate-validator</artifactId>
+ <groupId>org.hibernate</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.glassfish.jersey.ext</groupId>
+ </dependency>
+
+ <!-- http client -->
+ <dependency>
+ <artifactId>httpclient</artifactId>
+ <groupId>org.apache.httpcomponents</groupId>
+ <scope>compile</scope>
+ <version>${httpclient.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>httpcore</artifactId>
+ <groupId>org.apache.httpcomponents</groupId>
+ <scope>compile</scope>
+ <version>${httpcore.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ <scope>compile</scope>
+ <version>${commons-logging}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>commons-codec</artifactId>
+ <groupId>commons-codec</groupId>
+ <scope>compile</scope>
+ <version>${commons-codec}</version>
+ </dependency>
+ <!-- http client END -->
+
+ <dependency>
+ <artifactId>javax.servlet-api</artifactId>
+ <groupId>javax.servlet</groupId>
+ <scope>provided</scope>
+ <version>${servlet-api.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>org.eclipse.jgit</artifactId>
+ <groupId>org.eclipse.jgit</groupId>
+ <version>3.4.1.201406201815-r</version>
+ </dependency>
+
+ <!-- spring - used by A4C -->
+ <dependency>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ <scope>compile</scope>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>spring-context</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-expression</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.springframework</groupId>
+ <scope>compile</scope>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>spring-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.springframework</groupId>
+ <scope>compile</scope>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>spring-webmvc</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-expression</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-web</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.springframework</groupId>
+ <scope>compile</scope>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>spring-aop</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.springframework</groupId>
+ <scope>compile</scope>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>spring-beans</artifactId>
+ <groupId>org.springframework</groupId>
+ <scope>compile</scope>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>spring-expression</artifactId>
+ <groupId>org.springframework</groupId>
+ <scope>compile</scope>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <!-- Spring integration (optional) -->
+ <dependency>
+ <artifactId>togglz-spring-web</artifactId>
+ <groupId>org.togglz</groupId>
+ <version>${togglz.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>janino</artifactId>
+ <groupId>org.codehaus.janino</groupId>
+ <scope>compile</scope>
+ <version>${janino.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>commons-compiler</artifactId>
+ <groupId>org.codehaus.janino</groupId>
+ <scope>compile</scope>
+ <version>${janino.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>guava</artifactId>
+ <groupId>com.google.guava</groupId>
+ <scope>compile</scope>
+ <version>${guava.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>janusgraph-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>gremlin-groovy</artifactId>
+ <groupId>org.apache.tinkerpop</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>json</artifactId>
+ <groupId>org.json</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-collections</artifactId>
+ <groupId>commons-collections</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>libthrift</artifactId>
+ <groupId>org.apache.thrift</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-io</artifactId>
+ <groupId>commons-io</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-codec</artifactId>
+ <groupId>commons-codec</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>dom4j</artifactId>
+ <groupId>dom4j</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.janusgraph</groupId>
+ <scope>compile</scope>
+ <version>${janusgraph.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>janusgraph-cql</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>json</artifactId>
+ <groupId>org.json</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-collections</artifactId>
+ <groupId>commons-collections</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>groovy</artifactId>
+ <groupId>org.codehaus.groovy</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>netty-all</artifactId>
+ <groupId>io.netty</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.janusgraph</groupId>
+ <scope>compile</scope>
+ <version>${janusgraph.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>commons-lang3</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <scope>compile</scope>
+ <version>${lang3.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>json-simple</artifactId>
+ <groupId>com.googlecode.json-simple</groupId>
+ <scope>compile</scope>
+ <version>${json-simple.version}</version>
+
+ </dependency>
+
+ <!-- functional java -->
+ <dependency>
+ <artifactId>functionaljava</artifactId>
+ <groupId>org.functionaljava</groupId>
+ <scope>compile</scope>
+ <version>${functionaljava.version}</version>
+ </dependency>
+
+ <!-- Aspects -->
+ <dependency>
+ <artifactId>jcabi-aspects</artifactId>
+ <groupId>com.jcabi</groupId>
+ <scope>compile</scope>
+ <version>${jcabi.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>aspectjrt</artifactId>
+ <groupId>org.aspectj</groupId>
+ <scope>compile</scope>
+ <version>${aspectjrt.version}</version>
+ </dependency>
+
+
+ <!-- CAMBRIA CLIENT for U-EB -->
+ <dependency>
+ <artifactId>cambriaClient</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>saClientLibrary</artifactId>
+ <groupId>com.att.nsa</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>com.att.nsa</groupId>
+ <scope>compile</scope>
+ <version>1.2.1-oss</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>json</artifactId>
+ <groupId>org.json</groupId>
+ <scope>compile</scope>
+ <version>20131018</version>
+ </dependency>
+
+ <!-- CASSANDRA -->
+ <dependency>
+ <artifactId>cassandra-driver-core</artifactId>
+ <groupId>com.datastax.cassandra</groupId>
+ <scope>compile</scope>
+ <version>${cassandra.driver.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>cassandra-driver-mapping</artifactId>
+ <groupId>com.datastax.cassandra</groupId>
+ <scope>compile</scope>
+ <version>${cassandra.driver.version}</version>
+ </dependency>
+ <!-- CASSANDRA END -->
+
+ <!-- Inserted for ECOMP Portal Integration -->
+ <dependency>
+ <artifactId>esapi</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>xercesImpl</artifactId>
+ <groupId>xerces</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-fileupload</artifactId>
+ <groupId>commons-fileupload</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>xmlgraphics-commons</artifactId>
+ <groupId>org.apache.xmlgraphics</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>xml-apis-ext</artifactId>
+ <groupId>xml-apis</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>xml-apis</artifactId>
+ <groupId>xml-apis</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.owasp.esapi</groupId>
+ <version>${org.owasp.esapi.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>epsdk-fw</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>cambriaClient</artifactId>
+ <groupId>com.att.nsa</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>aaf-cadi-aaf</artifactId>
+ <groupId>org.onap.aaf.authz</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>aaf-cadi-core</artifactId>
+ <groupId>org.onap.aaf.authz</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-codec</artifactId>
+ <groupId>commons-codec</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.onap.portal.sdk</groupId>
+ <scope>compile</scope>
+ <version>${ecomp.version}</version>
+ </dependency>
+
+ <!--Jetty Proxy-->
+ <dependency>
+ <artifactId>jetty-http</artifactId>
+ <groupId>org.eclipse.jetty</groupId>
+ <scope>compile</scope>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jetty-proxy</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jetty-http</artifactId>
+ <groupId>org.eclipse.jetty</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.eclipse.jetty</groupId>
+ <scope>compile</scope>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jetty-servlets</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jetty-http</artifactId>
+ <groupId>org.eclipse.jetty</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jetty-continuation</artifactId>
+ <groupId>org.eclipse.jetty</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.eclipse.jetty</groupId>
+ <scope>compile</scope>
+ <version>${jetty.version}</version>
+ </dependency>
+ <!-- System metrics -->
+ <dependency>
+ <artifactId>sigar</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.fusesource</groupId>
+ <scope>compile</scope>
+ <version>${sigar.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>dmaapClient</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>dme2</artifactId>
+ <groupId>com.att.aft</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>apache-log4j-extras</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.onap.dmaap.messagerouter.dmaapclient</groupId>
+ <scope>compile</scope>
+ <version>1.1.3</version>
+ </dependency>
+ <dependency>
+ <artifactId>dme2</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jms</artifactId>
+ <groupId>javax.jms</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>com.att.aft</groupId>
+ <version>3.1.200-oss</version>
+ </dependency>
+
+ <!-- CADI -->
+ <dependency>
+ <artifactId>aaf-cadi-aaf</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>cassandra-driver-core</artifactId>
+ <groupId>com.datastax.cassandra</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.onap.aaf.authz</groupId>
+ <version>${cadi.version}</version>
+ </dependency>
+
+ <!-- TEST -->
+ <dependency>
+ <artifactId>assertj-core</artifactId>
+ <groupId>org.assertj</groupId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <artifactId>jersey-test-framework-provider-bundle</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jetty-server</artifactId>
+ <groupId>org.eclipse.jetty</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jetty-continuation</artifactId>
+ <groupId>org.eclipse.jetty</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <scope>test</scope>
+ <type>pom</type>
+ <version>${jersey-bom.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jersey-client</artifactId>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <version>${jersey-bom.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jetty-webapp</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jetty-servlet</artifactId>
+ <groupId>org.eclipse.jetty</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.eclipse.jetty</groupId>
+ <scope>test</scope>
+ <version>${jetty.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>hamcrest</artifactId>
+ <groupId>org.hamcrest</groupId>
+ <scope>test</scope>
+ <version>${hamcrest.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>hamcrest-library</artifactId>
+ <groupId>org.hamcrest</groupId>
+ <scope>test</scope>
+ <version>${hamcrest.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>junit-jupiter-api</artifactId>
+ <groupId>org.junit.jupiter</groupId>
+ <scope>test</scope>
+ <version>${junitJupiter.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>junit-jupiter</artifactId>
+ <groupId>org.junit.jupiter</groupId>
+ <scope>test</scope>
+ <version>${junitJupiter.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>junit-platform-commons</artifactId>
+ <groupId>org.junit.platform</groupId>
+ <scope>test</scope>
+ <version>${junit.platform.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>junit-platform-engine</artifactId>
+ <groupId>org.junit.platform</groupId>
+ <scope>test</scope>
+ <version>${junit.platform.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>mockito-junit-jupiter</artifactId>
+ <groupId>org.mockito</groupId>
+ <scope>test</scope>
+ <version>${mockitoJupiter.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>spring-test</artifactId>
+ <groupId>org.springframework</groupId>
+ <scope>test</scope>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>spring-tx</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.springframework</groupId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>cucumber-java</artifactId>
+ <groupId>io.cucumber</groupId>
+ <scope>test</scope>
+ <version>${cucumber.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>cucumber-junit</artifactId>
+ <groupId>io.cucumber</groupId>
+ <scope>test</scope>
+ <version>${cucumber.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jmockit</artifactId>
+ <groupId>org.jmockit</groupId>
+ <scope>test</scope>
+ <version>${jmockit.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>bean-matchers</artifactId>
+ <groupId>com.google.code.bean-matchers</groupId>
+ <scope>test</scope>
+ <version>0.11</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>groovy</artifactId>
+ <groupId>org.codehaus.groovy</groupId>
+ <version>${groovy.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>netty-handler</artifactId>
+ <groupId>io.netty</groupId>
+ </dependency>
+ <dependency>
+ <artifactId>onap-tosca-datatype</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.onap.sdc.common</groupId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>commons-collections4</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <version>${commons.collections.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>security-util-lib</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.onap.sdc.sdc-be-common</groupId>
+ <version>${security.util.lib.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>openecomp-tosca-lib</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-core</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-core</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.openecomp.sdc.core</groupId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <artifactId>validation-pmdictionary</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <groupId>org.apache.logging.log4j</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>org.onap.vnfsdk.validation</groupId>
+ <version>${onap.vnfsdk.validation.pmdictionary.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>jmapper-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>xstream</artifactId>
+ <groupId>com.thoughtworks.xstream</groupId>
+ </exclusion>
+ </exclusions>
+ <groupId>com.googlecode.jmapper-framework</groupId>
+ <version>${jMapper.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <packaging>war</packaging>
+
+ <parent>
+ <artifactId>sdc-main</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.10.0-SNAPSHOT</version>
+ </parent>
+
+ <profiles>
+ <profile>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <outputDirectory>
+ sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/files/default
+ </outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.build.directory}</directory>
+ <includes>
+ <include>normatives.tar.gz</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <id>copy-normatives</id>
+ <phase>package</phase>
+ </execution>
+ <execution>
+ <configuration>
+ <outputDirectory>
+ sdc-backend-init/
+ </outputDirectory>
+ <resources>
+ <resource>
+ <directory>
+ ${project.parent.basedir}/catalog-be/src/main/resources/
+ </directory>
+ <includes>
+ <include>scripts/sdcBePy/**</include>
+ <inculde>scripts/setup.py</inculde>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <id>copy-sdc-be-py</id>
+ <phase>verify</phase>
+ </execution>
+ </executions>
+ <groupId>org.apache.maven.plugins</groupId>
+ </plugin>
+ <plugin>
+ <artifactId>docker-maven-plugin</artifactId>
+ <configuration>
+ <apiVersion>${docker.api.version}</apiVersion>
+ <authConfig>
+ <pull>
+ <password>docker</password>
+ <username>docker</username>
+ </pull>
+ </authConfig>
+ <images>
+
+ <!-- Build backend image -->
+ <image>
+ <alias>sdc-backend</alias>
+ <build>
+ <assembly>
+ <descriptor>backend/backend-files.xml</descriptor>
+ <name>onap-sdc-backend</name>
+ </assembly>
+ <cleanup>try</cleanup>
+ <dockerFileDir>backend</dockerFileDir>
+ <tags>
+ <tag>latest</tag>
+ <tag>
+ ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest
+ </tag>
+ <tag>
+ ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-${maven.build.timestamp}
+ </tag>
+ </tags>
+ </build>
+ <name>onap/sdc-backend</name>
+ </image>
+ <!-- Build backend-init image -->
+ <image>
+ <alias>sdc-backend-init</alias>
+ <build>
+ <cleanup>try</cleanup>
+ <dockerFileDir>${project.basedir}/sdc-backend-init
+ </dockerFileDir>
+ <tags>
+ <tag>latest</tag>
+ <tag>
+ ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest
+ </tag>
+ <tag>
+ ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-${maven.build.timestamp}
+ </tag>
+ </tags>
+ </build>
+ <name>onap/sdc-backend-init</name>
+ </image>
+ </images>
+ <registry>nexus3.onap.org:10001</registry>
+ <verbose>${verbose}</verbose>
+ </configuration>
+ <executions>
+ <execution>
+ <configuration>
+ <image>onap/sdc-backend,onap/sdc-backend-init</image>
+ <removeAll>true</removeAll>
+ </configuration>
+ <goals>
+ <goal>remove</goal>
+ </goals>
+ <id>clean-images</id>
+ <phase>pre-clean</phase>
+ </execution>
+
+ <execution>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ <id>generate-images</id>
+ <phase>install</phase>
+ </execution>
+
+ <execution>
+ <configuration>
+ <image>onap/sdc-backend,onap/sdc-backend-init</image>
+ </configuration>
+ <goals>
+ <goal>push</goal>
+ </goals>
+ <id>push-images</id>
+ <phase>deploy</phase>
+ </execution>
+ </executions>
+ <groupId>io.fabric8</groupId>
+ </plugin>
+ </plugins>
+ </build>
+ <id>docker</id>
+ </profile>
+ </profiles>
+
+ <properties>
+ <java-hamcrest.version>2.0.0.0</java-hamcrest.version>
+ <maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version>
+ <replacer.plugin.version>1.5.3</replacer.plugin.version>
+ <swagger-ui.version>3.25.0</swagger-ui.version>
+ <swagger.version>${swagger-core-mvn-plugin.version}</swagger.version>
+ </properties>
</project>
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java
index b668ae7efc..3531fe786b 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java
@@ -28,6 +28,8 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
@@ -40,10 +42,7 @@ import org.openecomp.sdc.be.tosca.CapabilityRequirementConverter;
import org.openecomp.sdc.be.tosca.model.ToscaNodeTemplate;
import org.openecomp.sdc.be.tosca.model.ToscaTemplateRequirement;
-/**
- * @author KATYR
- * @since November 19, 2017
- */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ForwardingPathToscaUtil {
public static final String FORWARDS_TO_TOSCA_NAME = "org.openecomp.relationships.ForwardsTo";
@@ -97,8 +96,9 @@ public class ForwardingPathToscaUtil {
}
private static String fetchNodeName(Service service, String nodeId) {
- if (service.getComponentInstanceByName(nodeId).isPresent()) {
- return service.getComponentInstanceByName(nodeId).get().getName();
+ final Optional<ComponentInstance> componentInstanceByName = service.getComponentInstanceByName(nodeId);
+ if (componentInstanceByName.isPresent()) {
+ return componentInstanceByName.get().getName();
} else {
return "";
}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/path/ComponentInstanceForwardingPathMergeTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/path/ComponentInstanceForwardingPathMergeTest.java
index 8a575629af..50eaea9ad2 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/path/ComponentInstanceForwardingPathMergeTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/path/ComponentInstanceForwardingPathMergeTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,9 +20,16 @@
package org.openecomp.sdc.be.components.merge.path;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.Mockito.when;
+
import fj.data.Either;
-import org.junit.Before;
-import org.junit.Test;
+import java.util.Set;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -36,15 +43,6 @@ import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade;
import org.openecomp.sdc.common.api.UserRoleEnum;
-import java.util.Set;
-
-import static junit.framework.TestCase.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.Mockito.when;
-
public class ComponentInstanceForwardingPathMergeTest extends BaseForwardingPathVersionChangeTest {
@InjectMocks
@@ -57,7 +55,7 @@ public class ComponentInstanceForwardingPathMergeTest extends BaseForwardingPath
private ToscaOperationFacade toscaOperationFacade;
private User user;
- @Before
+ @BeforeEach
public void setUpData() {
MockitoAnnotations.initMocks(this);
user = new User();
@@ -73,7 +71,6 @@ public class ComponentInstanceForwardingPathMergeTest extends BaseForwardingPath
Component componentResponseFormatEither = testInstance
.mergeDataAfterCreate(user, dataHolder, newNodeAC, "3344");
assertNotNull(componentResponseFormatEither);
- assertTrue(componentResponseFormatEither != null);
assertEquals(newNodeAC, componentResponseFormatEither);
}
@@ -102,18 +99,18 @@ public class ComponentInstanceForwardingPathMergeTest extends BaseForwardingPath
@Test
public void mergeShouldUpdate() {
- when(serviceBusinessLogic.updateForwardingPath(any(), any(), any(), anyBoolean()))
- .then(invocationOnMock -> service);
- when(toscaOperationFacade.getToscaFullElement(any())).thenReturn(Either.left(newNodeAC));
- testInstance.saveDataBeforeMerge(dataHolder, service, nodeACI, newNodeAC);
- assertEquals(nodeACI.getName(), dataHolder.getOrigComponentInstId());
-
- // Change internal ci, just like change version do
- service.getComponentInstances().remove(nodeACI);
- service.getComponentInstances().add(newNodeACI);
-
- Component component = testInstance.mergeDataAfterCreate(user, dataHolder, service, newNodeA);
- assertNotNull(component);
+ when(serviceBusinessLogic.updateForwardingPath(any(), any(), any(), anyBoolean()))
+ .then(invocationOnMock -> service);
+ when(toscaOperationFacade.getToscaFullElement(any())).thenReturn(Either.left(newNodeAC));
+ testInstance.saveDataBeforeMerge(dataHolder, service, nodeACI, newNodeAC);
+ assertEquals(nodeACI.getName(), dataHolder.getOrigComponentInstId());
+
+ // Change internal ci, just like change version do
+ service.getComponentInstances().remove(nodeACI);
+ service.getComponentInstances().add(newNodeACI);
+
+ Component component = testInstance.mergeDataAfterCreate(user, dataHolder, service, newNodeA);
+ assertNotNull(component);
}
@Test
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathTest.java
index 0fa7ca8cb6..e9c1d40121 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,8 +20,8 @@
package org.openecomp.sdc.be.components.path;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
import org.openecomp.sdc.be.components.BeConfDependentTest;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic;
import org.openecomp.sdc.be.components.path.beans.JanusGraphTestSetup;
import org.openecomp.sdc.be.components.path.utils.GraphTestUtils;
import org.openecomp.sdc.be.components.validation.service.ServiceValidator;
+import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.janusgraph.JanusGraphClient;
import org.openecomp.sdc.be.dao.janusgraph.JanusGraphDao;
@@ -63,6 +65,8 @@ import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder;
import org.openecomp.sdc.be.tosca.CapabilityRequirementConverter;
import org.openecomp.sdc.be.user.Role;
import org.openecomp.sdc.common.datastructure.UserContext;
+import org.openecomp.sdc.common.impl.ExternalConfiguration;
+import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.openecomp.sdc.common.util.ThreadLocalsHolder;
import org.openecomp.sdc.common.util.ValidationUtils;
import org.openecomp.sdc.exception.ResponseFormat;
@@ -70,42 +74,44 @@ import org.springframework.beans.factory.annotation.Autowired;
public abstract class BaseForwardingPathTest extends BeConfDependentTest implements ForwardingPathTestUtils {
-
+ static final String FORWARDING_PATH_ID = "forwarding_pathId";
+ static final String HTTP_PROTOCOL = "http";
+ private static final String CATEGORY_NAME = "cat_name";
+ private static final String INSTANTIATION_TYPE = "A-la-carte";
+ private static final String CAPABILITY_NAME_1 = "CP1";
+ private static final String CAPABILITY_NAME_2 = "CP2";
+ private static final String CAPABILITY_NAME_3 = "CP3";
+ private static final String CI_NAME_1 = "CI1";
+ private static final String CI_NAME_2 = "CI2";
+ private static final String CI_NAME_3 = "CI3";
protected User user;
- private ForwardingPathDataDefinition forwardingPathDataDefinition;
-
@Autowired
protected JanusGraphClient janusGraphClient;
-
@Autowired
protected CapabilityRequirementConverter capabiltyRequirementConvertor;
-
@Autowired
protected ToscaOperationFacade toscaOperationFacade;
-
@Autowired
protected ServiceBusinessLogic bl;
-
- private CatalogOperation catalogOperation = mock(CatalogOperation.class);
-
- private ServiceValidator serviceValidator = mock(ServiceValidator.class);
@Autowired
protected IElementOperation elementDao;
-
@Autowired
protected ComponentInstanceBusinessLogic componentInstanceBusinessLogic;
-
@javax.annotation.Resource
protected JanusGraphDao janusGraphDao;
+ private ForwardingPathDataDefinition forwardingPathDataDefinition;
+ private CatalogOperation catalogOperation = mock(CatalogOperation.class);
+ private ServiceValidator serviceValidator = mock(ServiceValidator.class);
+ private CategoryDefinition categoryDefinition;
- @Before
+ @BeforeEach
public void initJanusGraph() {
JanusGraphTestSetup.createGraph(janusGraphClient.getGraph().left().value());
categoryDefinition = new CategoryDefinition();
categoryDefinition.setName(CATEGORY_NAME);
}
- @Before
+ @BeforeEach
public void initUser() {
// User data and management
user = new User();
@@ -115,25 +121,11 @@ public abstract class BaseForwardingPathTest extends BeConfDependentTest impleme
user.setRole(Role.ADMIN.name());
Set<String> userRole = new HashSet<>();
userRole.add(user.getRole());
- UserContext userContext = new UserContext(user.getUserId(), userRole, user.getFirstName() ,user.getLastName());
+ UserContext userContext = new UserContext(user.getUserId(), userRole, user.getFirstName(), user.getLastName());
ThreadLocalsHolder.setUserContext(userContext);
bl.setServiceValidator(serviceValidator);
}
-
- private CategoryDefinition categoryDefinition;
- private static final String CATEGORY_NAME = "cat_name";
- static final String FORWARDING_PATH_ID = "forwarding_pathId";
- static final String HTTP_PROTOCOL = "http";
- private static final String INSTANTIATION_TYPE = "A-la-carte";
- private static final String CAPABILITY_NAME_1 = "CP1";
- private static final String CAPABILITY_NAME_2 = "CP2";
- private static final String CAPABILITY_NAME_3 = "CP3";
- private static final String CI_NAME_1 = "CI1";
- private static final String CI_NAME_2 = "CI2";
- private static final String CI_NAME_3 = "CI3";
-
-
private void initGraph() {
Map<GraphPropertyEnum, Object> props = new HashMap<>();
props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true);
@@ -176,7 +168,7 @@ public abstract class BaseForwardingPathTest extends BeConfDependentTest impleme
private void createCategory() {
Either<CategoryDefinition, ActionStatus> category = elementDao.createCategory(categoryDefinition, NodeTypeEnum.ServiceNewCategory);
- assertTrue("Failed to create category", category.isLeft());
+ assertTrue(category.isLeft(), "Failed to create category");
}
private void createServiceCategory(String categoryName) {
@@ -196,7 +188,7 @@ public abstract class BaseForwardingPathTest extends BeConfDependentTest impleme
assertTrue(catRes.isLeft());
}
- Service initForwardPath() {
+ public Service initForwardPath() {
ForwardingPathDataDefinition forwardingPathDataDefinition = createMockPath();
Service service = new Service();
service.setUniqueId(FORWARDING_PATH_ID);
@@ -213,8 +205,10 @@ public abstract class BaseForwardingPathTest extends BeConfDependentTest impleme
forwardingPathDataDefinition.setDestinationPortNumber("414155");
forwardingPathDataDefinition.setProtocol(HTTP_PROTOCOL);
org.openecomp.sdc.be.datatypes.elements.ListDataDefinition<org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition> forwardingPathElementDataDefinitionListDataDefinition = new org.openecomp.sdc.be.datatypes.elements.ListDataDefinition<>();
- forwardingPathElementDataDefinitionListDataDefinition.add(new ForwardingPathElementDataDefinition(CI_NAME_1, CI_NAME_2, CAPABILITY_NAME_1, CAPABILITY_NAME_2, "2222", "5555"));
- forwardingPathElementDataDefinitionListDataDefinition.add(new ForwardingPathElementDataDefinition(CI_NAME_2, CI_NAME_3, CAPABILITY_NAME_2, CAPABILITY_NAME_3, "4", "44"));
+ forwardingPathElementDataDefinitionListDataDefinition.add(
+ new ForwardingPathElementDataDefinition(CI_NAME_1, CI_NAME_2, CAPABILITY_NAME_1, CAPABILITY_NAME_2, "2222", "5555"));
+ forwardingPathElementDataDefinitionListDataDefinition.add(
+ new ForwardingPathElementDataDefinition(CI_NAME_2, CI_NAME_3, CAPABILITY_NAME_2, CAPABILITY_NAME_3, "4", "44"));
forwardingPathDataDefinition.setPathElements(forwardingPathElementDataDefinitionListDataDefinition);
return forwardingPathDataDefinition;
}
@@ -222,7 +216,7 @@ public abstract class BaseForwardingPathTest extends BeConfDependentTest impleme
Service createService() {
Either<Service, ResponseFormat> serviceCreateResult;
serviceCreateResult = bl.createService(createTestService(), user);
- assertTrue("Failed to create service", serviceCreateResult.isLeft());
+ assertTrue(serviceCreateResult.isLeft(), "Failed to create service");
return serviceCreateResult.left().value();
}
}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathVersionChangeTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathVersionChangeTest.java
index 5eca2b35a4..d4d0b9150c 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathVersionChangeTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/BaseForwardingPathVersionChangeTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,7 +21,11 @@
package org.openecomp.sdc.be.components.path;
import com.google.common.collect.Lists;
-import org.junit.Before;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.junit.jupiter.api.BeforeEach;
import org.openecomp.sdc.be.components.merge.instance.DataForMergeHolder;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
@@ -33,27 +37,22 @@ 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;
-
public abstract class BaseForwardingPathVersionChangeTest {
- protected Service service;
- protected ComponentInstance nodeACI;
- protected ComponentInstance newNodeACI;
- protected Component newNodeAC;
- protected Component newNodeWithoutCapability;
- protected DataForMergeHolder dataHolder;
+
protected static final String nodeA = "nodeA";
protected static final String NODE_A_FORWARDER_CAPABILITY = "nodeA_FORWARDER_CAPABILITY";
protected static final String nodeB = "nodeB";
protected static final String newNodeA = "newNodeA";
protected static final String fpName = "fpName";
protected static final String FPId = "1122";
+ protected Service service;
+ protected ComponentInstance nodeACI;
+ protected ComponentInstance newNodeACI;
+ protected Component newNodeAC;
+ protected Component newNodeWithoutCapability;
+ protected DataForMergeHolder dataHolder;
-
- @Before
+ @BeforeEach
public void initService() {
service = new Service();
ForwardingPathDataDefinition forwardingPath = new ForwardingPathDataDefinition(fpName);
@@ -64,7 +63,7 @@ public abstract class BaseForwardingPathVersionChangeTest {
= new ListDataDefinition<>();
forwardingPathElementListDataDefinition.add(
- new ForwardingPathElementDataDefinition(nodeA, nodeB, NODE_A_FORWARDER_CAPABILITY, "nodeBcpType" , "nodeDcpName",
+ new ForwardingPathElementDataDefinition(nodeA, nodeB, NODE_A_FORWARDER_CAPABILITY, "nodeBcpType", "nodeDcpName",
"nodeBcpName"));
forwardingPath.setPathElements(forwardingPathElementListDataDefinition);
Map<String, ForwardingPathDataDefinition> forwardingPaths = new HashMap<>();
@@ -75,10 +74,10 @@ public abstract class BaseForwardingPathVersionChangeTest {
newNodeACI = new ComponentInstance();
initComponentInstance(newNodeACI, newNodeA);
newNodeAC = new Resource();
- newNodeWithoutCapability=new Resource();
+ newNodeWithoutCapability = new Resource();
initComponent(newNodeAC, newNodeA);
service.setComponentInstances(Lists.newArrayList(newNodeACI));
- initComponentWithoutForwarder(newNodeWithoutCapability,"newNodeC");
+ initComponentWithoutForwarder(newNodeWithoutCapability, "newNodeC");
service.setComponentInstances(Lists.newArrayList(nodeACI));
dataHolder = new DataForMergeHolder();
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathBusinessLogicTest.java
index 49c25832cc..5f0282b7d6 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathBusinessLogicTest.java
@@ -16,49 +16,58 @@
package org.openecomp.sdc.be.components.path;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import fj.data.Either;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.openecomp.sdc.be.components.impl.exceptions.ComponentException;
+import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
import org.openecomp.sdc.be.datatypes.enums.ComponentFieldsEnum;
import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer;
import org.openecomp.sdc.be.ui.model.UiServiceDataTransfer;
+import org.openecomp.sdc.common.impl.ExternalConfiguration;
+import org.openecomp.sdc.common.impl.FSConfigurationSource;
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 org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = "/paths/path-context.xml")
-@Ignore
+@SpringJUnitConfig(locations = "classpath:paths/path-context.xml")
public class ForwardingPathBusinessLogicTest extends BaseForwardingPathTest {
- @Test(expected = ComponentException.class)
+ @BeforeAll
+ private static void setup() {
+ configurationManager =
+ new ConfigurationManager(new FSConfigurationSource(ExternalConfiguration.getChangeListener(), "src/test/resources/config/catalog-be"));
+ }
+
+ @Test
public void shouldFailToUpdateForwardingPathSincePathDoesNotExist() {
- Service service = initForwardPath();
- bl.updateForwardingPath(FORWARDING_PATH_ID, service, user, true);
+ Assertions.assertThrows(ComponentException.class, () -> {
+ Service service = initForwardPath();
+ bl.updateForwardingPath(FORWARDING_PATH_ID, service, user, true);
+ });
}
- @Test(expected = ComponentException.class)
+ @Test
public void shouldFailToDeleteForwardingPathSincePathDoesNotExist() {
- initForwardPath();
- bl.deleteForwardingPaths("delete_forward_test", Sets.newHashSet(FORWARDING_PATH_ID), user, true);
+ Assertions.assertThrows(ComponentException.class, () -> {
+ initForwardPath();
+ bl.deleteForwardingPaths("delete_forward_test", Sets.newHashSet(FORWARDING_PATH_ID), user, true);
+ });
}
- @Test
+ @Test
public void shouldSucceedCreateAndDeleteForwardingPath() {
Service createdService = createService();
Service service = initForwardPath();
@@ -71,7 +80,8 @@ public class ForwardingPathBusinessLogicTest extends BaseForwardingPathTest {
String toscaResourceName = forwardingPathsMap.values().iterator().next().getToscaResourceName();
// should return the created path
- Either<UiComponentDataTransfer, ResponseFormat> uiResaponse = bl.getComponentDataFilteredByParams(createdService.getUniqueId(), user, Lists.newArrayList(ComponentFieldsEnum.FORWARDING_PATHS.getValue()));
+ Either<UiComponentDataTransfer, ResponseFormat> uiResaponse = bl.getComponentDataFilteredByParams(createdService.getUniqueId(), user,
+ Lists.newArrayList(ComponentFieldsEnum.FORWARDING_PATHS.getValue()));
assertTrue(uiResaponse.isLeft());
UiServiceDataTransfer uiServiceDataTransfer = (UiServiceDataTransfer) uiResaponse.left().value();
Map<String, ForwardingPathDataDefinition> forwardingPaths = uiServiceDataTransfer.getForwardingPaths();
@@ -93,7 +103,8 @@ public class ForwardingPathBusinessLogicTest extends BaseForwardingPathTest {
assertTrue(serviceResponseFormatEither != null);
// make sure changes were applied
- uiResaponse = bl.getComponentDataFilteredByParams(createdService.getUniqueId(), user, Lists.newArrayList(ComponentFieldsEnum.FORWARDING_PATHS.getValue()));
+ uiResaponse = bl.getComponentDataFilteredByParams(createdService.getUniqueId(), user,
+ Lists.newArrayList(ComponentFieldsEnum.FORWARDING_PATHS.getValue()));
assertTrue(uiResaponse.isLeft());
uiServiceDataTransfer = (UiServiceDataTransfer) uiResaponse.left().value();
Map<String, ForwardingPathDataDefinition> forwardingPathsUpdated = uiServiceDataTransfer.getForwardingPaths();
@@ -107,7 +118,8 @@ public class ForwardingPathBusinessLogicTest extends BaseForwardingPathTest {
assertTrue(setResponseFormatEither != null);
// nothing to return now
- uiResaponse = bl.getComponentDataFilteredByParams(createdService.getUniqueId(), user, Lists.newArrayList(ComponentFieldsEnum.COMPONENT_INSTANCES.getValue(),ComponentFieldsEnum.FORWARDING_PATHS.getValue()));
+ uiResaponse = bl.getComponentDataFilteredByParams(createdService.getUniqueId(), user,
+ Lists.newArrayList(ComponentFieldsEnum.COMPONENT_INSTANCES.getValue(), ComponentFieldsEnum.FORWARDING_PATHS.getValue()));
assertTrue(uiResaponse.isLeft());
uiServiceDataTransfer = (UiServiceDataTransfer) uiResaponse.left().value();
forwardingPaths = uiServiceDataTransfer.getForwardingPaths();
@@ -115,8 +127,4 @@ public class ForwardingPathBusinessLogicTest extends BaseForwardingPathTest {
}
-
-
-
}
-
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathChangeVersionTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathChangeVersionTest.java
index fd305b5f22..deab6ee161 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathChangeVersionTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathChangeVersionTest.java
@@ -21,7 +21,7 @@
package org.openecomp.sdc.be.components.path;
import org.javatuples.Pair;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.impl.ForwardingPathUtils;
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathDeleteCITest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathDeleteCITest.java
index efef9bd799..55c123f9aa 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathDeleteCITest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathDeleteCITest.java
@@ -20,8 +20,8 @@
package org.openecomp.sdc.be.components.path;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
@@ -44,7 +44,7 @@ public class ForwardingPathDeleteCITest {
private static final String nodeB = "nodeB";
private static final String fpName = "fpName";
- @Before
+ @BeforeEach
public void initService() {
service = new Service();
ForwardingPathDataDefinition forwardingPath = new ForwardingPathDataDefinition(fpName);
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathRenameNodeTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathRenameNodeTest.java
index 886cda05da..1af5c80cd2 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathRenameNodeTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathRenameNodeTest.java
@@ -17,7 +17,7 @@
package org.openecomp.sdc.be.components.path;
import com.google.common.collect.Sets;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.impl.ForwardingPathUtils;
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathToscaUtilTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathToscaUtilTest.java
deleted file mode 100644
index 1b680fae50..0000000000
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathToscaUtilTest.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.be.components.path;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
-import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
-import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
-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 org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.tosca.model.ToscaNodeTemplate;
-import org.openecomp.sdc.be.tosca.model.ToscaTemplateRequirement;
-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
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = "/paths/path-context.xml")
-@Ignore
-public class ForwardingPathToscaUtilTest extends BaseForwardingPathTest {
-
- private static final String NODE_NAME_1 = "nodeA-name";
- private static final String NODE_NAME_2 = "nodeB-name";
- private static final String PATH_1_PROTOCOL = "protocol-path1";
- private static final String PATH_1_DESC = "path1-desc";
- private static final String PATH_1_PORTS = "8585";
- private static final String PATH_1_NAME = "pathName1";
- private Service service;
- private Map<String, Component> originComponents = new HashMap<>();
- private static final String NODE_ID_1 = "nodeA-id";
- private static final String NODE_ID_2 = "nodeB-id";
- private static final String FORWARDING_PATH_TOSCA_TYPE = "org.openecomp.nodes.ForwardingPath";
-
-
- @Before
- public void setUpForwardingPath() {
- service = initForwardPath();
- List<ComponentInstance> componentInstances = new ArrayList<>();
- componentInstances.add(generateComponentInstance(NODE_NAME_1, NODE_ID_1));
- componentInstances.add(generateComponentInstance(NODE_NAME_2, NODE_ID_2));
- service.setComponentInstances(componentInstances);
- }
-
- private ComponentInstance generateComponentInstance(String name, String uuid) {
- ComponentInstance componentInstance = new ComponentInstance();
- componentInstance.setName(name);
- componentInstance.setUniqueId(uuid);
- componentInstance.setComponentUid(uuid);
- Map<String, List<CapabilityDefinition>> capabiltiesMap = new HashMap<>();
- CapabilityDefinition capabilityDefinition = new CapabilityDefinition();
- capabilityDefinition.setMinOccurrences(Integer.toString(1));
- capabilityDefinition.setMaxOccurrences(Integer.toString(100));
- capabilityDefinition.setType(ForwardingPathToscaUtil.FORWARDS_TO_TOSCA_NAME);
- capabilityDefinition.setName(name);
- capabilityDefinition.setUniqueId(name);
- capabilityDefinition.setPath(Arrays.asList("Just", "something", "to", "read"));
- capabiltiesMap.put(capabilityDefinition.getName(),
- Collections.singletonList(capabilityDefinition));
- componentInstance.setCapabilities(capabiltiesMap);
- Resource resource = new Resource();
- resource.setToscaResourceName("test");
- originComponents.put(uuid, resource);
- return componentInstance;
- }
-
-
- @Test
- public void singleElementPath() {
- try {
- createPathSingleElement();
- Map<String, ToscaNodeTemplate> nodeTemplatesRes = new HashMap<>();
-
- Map<String, ToscaNodeTemplate> expectedNodeTemplatesRes = new HashMap<>();
- ToscaNodeTemplate pathEntry = new ToscaNodeTemplate();
- pathEntry.setType(FORWARDING_PATH_TOSCA_TYPE);
- Map<String, Object> expectedProps = new HashMap<>();
- expectedProps.put(PORTS_RANGE, Collections.singletonList(PATH_1_PORTS));
- expectedProps.put(PROTOCOL, PATH_1_PROTOCOL);
- pathEntry.setProperties(expectedProps);
- List<Map<String, ToscaTemplateRequirement>> requirements = new ArrayList<>();
- ToscaTemplateRequirement firstEntryReq = new ToscaTemplateRequirement();
- ToscaTemplateRequirement secondEntryReq = new ToscaTemplateRequirement();
-
- firstEntryReq.setCapability("null." + NODE_NAME_1);
- secondEntryReq.setCapability("null." + NODE_NAME_2);
-
- firstEntryReq.setNode(NODE_NAME_1);
- secondEntryReq.setNode(NODE_NAME_2);
-
- firstEntryReq.setRelationship(FORWARDS_TO_TOSCA_NAME);
- secondEntryReq.setRelationship(FORWARDS_TO_TOSCA_NAME);
-
- Map<String, ToscaTemplateRequirement> entryMap1 = new HashMap<>();
- Map<String, ToscaTemplateRequirement> entryMap2 = new HashMap<>();
-
- entryMap1.put(FORWARDER, firstEntryReq);
- entryMap2.put(FORWARDER, secondEntryReq);
-
- requirements.add(entryMap1);
- requirements.add(entryMap2);
-
- pathEntry.setRequirements(requirements);
- expectedNodeTemplatesRes.put(PATH_1_NAME, pathEntry);
- addForwardingPaths(service, nodeTemplatesRes, capabiltyRequirementConvertor, originComponents,
- toscaOperationFacade);
-
- assertEquals(2, nodeTemplatesRes.get(PATH_1_NAME).getRequirements().size());
- compareToscaPathEntry(expectedNodeTemplatesRes, nodeTemplatesRes);
- } catch (Exception e){
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- }
-
- private void compareToscaPathEntry(Map<String, ToscaNodeTemplate> expectedNodeTemplatesRes,
- Map<String, ToscaNodeTemplate> nodeTemplatesRes) {
- final ToscaNodeTemplate expectedTemplate = expectedNodeTemplatesRes.get(PATH_1_NAME);
- final ToscaNodeTemplate actualTemplate = nodeTemplatesRes.get(PATH_1_NAME);
- assertEquals(expectedTemplate.getProperties(), actualTemplate.getProperties());
- final int size = expectedTemplate.getRequirements().size();
- assertEquals(size,
- actualTemplate.getRequirements().size());
- for (int i = 0; i < size; i++) {
- compareToscaRequirement(expectedTemplate, actualTemplate, i);
- }
- }
-
- private void compareToscaRequirement(ToscaNodeTemplate expectedTemplate,
- ToscaNodeTemplate actualTemplate,
- int i) {
- final ToscaTemplateRequirement actualRequirement =
- actualTemplate.getRequirements().get(i).get(FORWARDER);
- final ToscaTemplateRequirement expectedToscaRequirement = expectedTemplate
- .getRequirements()
- .get(i).get(FORWARDER);
- assertEquals(actualRequirement.getCapability(), expectedToscaRequirement.getCapability());
- assertEquals(actualRequirement.getNode(), expectedToscaRequirement.getNode());
- }
-
- private void createPathSingleElement() {
- ForwardingPathElementDataDefinition element1 = initElement(NODE_NAME_1, NODE_NAME_2, NODE_NAME_1,
- NODE_NAME_2);
-
- ListDataDefinition<ForwardingPathElementDataDefinition> list = new ListDataDefinition<>();
- list.add(element1);
-
-
- ForwardingPathDataDefinition path = new ForwardingPathDataDefinition();
- path.setDescription(PATH_1_DESC);
- path.setProtocol(PATH_1_PROTOCOL);
- path.setDestinationPortNumber(PATH_1_PORTS);
- path.setToscaResourceName(FORWARDING_PATH_TOSCA_TYPE);
- path.setPathElements(list);
- path.setName(PATH_1_NAME);
-
- Map<String, ForwardingPathDataDefinition> paths = new HashMap<>();
- paths.put(PATH_1_NAME, path);
-
- service.setForwardingPaths(paths);
- }
-
- private ForwardingPathElementDataDefinition initElement(String fromId, String toId, String
- fromCP, String toCP) {
- ForwardingPathElementDataDefinition element = new ForwardingPathElementDataDefinition();
- element.setFromCP(fromCP);
- element.setFromNode(fromId);
- element.setToCP(toCP);
- element.setToNode(toId);
- return element;
- }
-} \ No newline at end of file
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathValidatorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathValidatorTest.java
index 6123561d45..ae44ceac90 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathValidatorTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/ForwardingPathValidatorTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,10 +21,16 @@
package org.openecomp.sdc.be.components.path;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
import com.google.common.collect.Sets;
import fj.data.Either;
-import org.junit.Before;
-import org.junit.Test;
+import java.util.Collection;
+import java.util.Set;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
@@ -42,30 +48,17 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.Collection;
-import java.util.Set;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.when;
-
public class ForwardingPathValidatorTest implements ForwardingPathTestUtils {
+ private static final String SERVICE_ID = "serviceid1";
ResponseFormatManager mock;
-
- private Service service = (Service) getToscaFullElement().left().value();
-
-
@Mock
ToscaOperationFacade toscaOperationFacade;
@InjectMocks
ForwardingPathValidationUtilTest test = new ForwardingPathValidationUtilTest();
+ private Service service = (Service) getToscaFullElement().left().value();
- private static final String SERVICE_ID = "serviceid1";
-
-
-
-
- @Before
+ @BeforeEach
public void init() {
MockitoAnnotations.initMocks(this);
mock = Mockito.mock(ResponseFormatManager.class);
@@ -78,60 +71,65 @@ public class ForwardingPathValidatorTest implements ForwardingPathTestUtils {
}
@Test
- public void testValidForwardingPathName(){
+ public void testValidForwardingPathName() {
Collection<ForwardingPathDataDefinition> paths = createData("pathName", "http", "8285", "pathName");
test.validateForwardingPaths(paths, SERVICE_ID, false);
}
- @Test(expected = ComponentException.class)
- public void testEmptyForwardingPathName(){
- Collection<ForwardingPathDataDefinition> paths = createData("", "protocol", "8285", "name1");
- test.validateForwardingPaths(paths, SERVICE_ID, false);
+ @Test
+ public void testEmptyForwardingPathName() {
+ Assertions.assertThrows(ComponentException.class, () -> {
+ Collection<ForwardingPathDataDefinition> paths = createData("", "protocol", "8285", "name1");
+ test.validateForwardingPaths(paths, SERVICE_ID, false);
+ });
}
- @Test(expected = ComponentException.class)
- public void testLongForwardingPathName(){
- String pathName = "Failed to execute goal on project catalog-be: Could not resolve dependencies for project \n" +
+ @Test
+ public void testLongForwardingPathName() {
+ Assertions.assertThrows(ComponentException.class, () -> {
+ String pathName = "Failed to execute goal on project catalog-be: Could not resolve dependencies for project \n" +
"org.openecomp.sdc:catalog-be:war:1.1.0-SNAPSHOT: Failed to collect dependencies at \n" +
"org.openecomp.sdc.common:openecomp-sdc-artifact-generator-api:jar:1802.0.1.167: ";
- Collection<ForwardingPathDataDefinition> paths = createData(pathName,
+ Collection<ForwardingPathDataDefinition> paths = createData(pathName,
"http", "port", "name1");
- test.validateForwardingPaths(paths, SERVICE_ID, false);
-
+ test.validateForwardingPaths(paths, SERVICE_ID, false);
+ });
}
@Test
- public void testUniqueForwardingPathNameUpdateName(){
+ public void testUniqueForwardingPathNameUpdateName() {
Collection<ForwardingPathDataDefinition> paths = createData("pathName4", "httpfd", "82df85", "name1");
test.validateForwardingPaths(paths, SERVICE_ID, true);
}
@Test
- public void testUniqueForwardingPathNameUpdatePort(){
+ public void testUniqueForwardingPathNameUpdatePort() {
Collection<ForwardingPathDataDefinition> paths = createData("pathName3", "httpfd", "82df85", "name1");
test.validateForwardingPaths(paths, SERVICE_ID, true);
}
- @Test(expected = ComponentException.class)
- public void testLongForwardingPathPortNumber(){
- String port = "Failed to execute goal on project catalog-be: Could not resolve dependencies for project \n" +
+ @Test
+ public void testLongForwardingPathPortNumber() {
+ Assertions.assertThrows(ComponentException.class, () -> {
+ String port = "Failed to execute goal on project catalog-be: Could not resolve dependencies for project \n" +
"org.openecomp.sdc:catalog-be:war:1.1.0-SNAPSHOT: Failed to collect dependencies at \n" +
"org.openecomp.sdc.common:openecomp-sdc-artifact-generator-api:jar:1802.0.1.167: ";
- Collection<ForwardingPathDataDefinition> paths = createData("pathName",
+ Collection<ForwardingPathDataDefinition> paths = createData("pathName",
"http", port, "name1");
- test.validateForwardingPaths(paths, SERVICE_ID, false);
-
+ test.validateForwardingPaths(paths, SERVICE_ID, false);
+ });
}
- @Test(expected = ComponentException.class)
- public void testLongForwardingPathProtocol(){
- String protocol = "Failed to execute goal on project catalog-be: Could not resolve dependencies for project \n" +
+ @Test
+ public void testLongForwardingPathProtocol() {
+ Assertions.assertThrows(ComponentException.class, () -> {
+ String protocol = "Failed to execute goal on project catalog-be: Could not resolve dependencies for project \n" +
"org.openecomp.sdc:catalog-be:war:1.1.0-SNAPSHOT: Failed to collect dependencies at \n" +
"org.openecomp.sdc.common:openecomp-sdc-artifact-generator-api:jar:1802.0.1.167: ";
- Collection<ForwardingPathDataDefinition> paths = createData("pathName",
+ Collection<ForwardingPathDataDefinition> paths = createData("pathName",
protocol, "port", "name1");
- test.validateForwardingPaths(paths, SERVICE_ID, false);
-
+ test.validateForwardingPaths(paths, SERVICE_ID, false);
+ });
}
private Set<ForwardingPathDataDefinition> createData(String pathName, String protocol, String ports, String uniqueId) {
@@ -140,15 +138,15 @@ public class ForwardingPathValidatorTest implements ForwardingPathTestUtils {
}
- private <T extends Component> Either<T, StorageOperationStatus> getToscaFullElement() {
+ private <T extends Component> Either<T, StorageOperationStatus> getToscaFullElement() {
return Either.left((T) setUpServiceMcok());
}
- private Service setUpServiceMcok(){
- Service service = new Service();
- service.addForwardingPath(createPath("pathName3", "http", "8285", "name1"));
- return service;
+ private Service setUpServiceMcok() {
+ Service service = new Service();
+ service.addForwardingPath(createPath("pathName3", "http", "8285", "name1"));
+ return service;
}
private class ForwardingPathValidationUtilTest extends ForwardingPathValidator {
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtilTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtilTest.java
new file mode 100644
index 0000000000..3b8089e858
--- /dev/null
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtilTest.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.sdc.be.tosca.utils;
+
+import static org.junit.jupiter.api.Assertions.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.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.openecomp.sdc.be.components.path.BaseForwardingPathTest;
+import org.openecomp.sdc.be.config.ConfigurationManager;
+import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
+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 org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.tosca.model.ToscaNodeTemplate;
+import org.openecomp.sdc.be.tosca.model.ToscaTemplateRequirement;
+import org.openecomp.sdc.common.impl.ExternalConfiguration;
+import org.openecomp.sdc.common.impl.FSConfigurationSource;
+import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
+
+@SpringJUnitConfig(locations = "classpath:paths/path-context.xml")
+public class ForwardingPathToscaUtilTest extends BaseForwardingPathTest {
+
+ private static final String NODE_NAME_1 = "nodeA-name";
+ private static final String NODE_NAME_2 = "nodeB-name";
+ private static final String PATH_1_PROTOCOL = "protocol-path1";
+ private static final String PATH_1_DESC = "path1-desc";
+ private static final String PATH_1_PORTS = "8585";
+ private static final String PATH_1_NAME = "pathName1";
+ private static final String NODE_ID_1 = "nodeA-id";
+ private static final String NODE_ID_2 = "nodeB-id";
+ private static final String FORWARDING_PATH_TOSCA_TYPE = "org.openecomp.nodes.ForwardingPath";
+ private Service service;
+ private Map<String, Component> originComponents = new HashMap<>();
+
+ @BeforeAll
+ private static void setup() {
+ configurationManager =
+ new ConfigurationManager(new FSConfigurationSource(ExternalConfiguration.getChangeListener(), "src/test/resources/config/catalog-be"));
+ }
+
+ @BeforeEach
+ public void setUpForwardingPath() {
+ service = initForwardPath();
+ List<ComponentInstance> componentInstances = new ArrayList<>();
+ componentInstances.add(generateComponentInstance(NODE_NAME_1, NODE_ID_1));
+ componentInstances.add(generateComponentInstance(NODE_NAME_2, NODE_ID_2));
+ service.setComponentInstances(componentInstances);
+ }
+
+ private ComponentInstance generateComponentInstance(String name, String uuid) {
+ ComponentInstance componentInstance = new ComponentInstance();
+ componentInstance.setName(name);
+ componentInstance.setUniqueId(uuid);
+ componentInstance.setComponentUid(uuid);
+ Map<String, List<CapabilityDefinition>> capabiltiesMap = new HashMap<>();
+ CapabilityDefinition capabilityDefinition = new CapabilityDefinition();
+ capabilityDefinition.setMinOccurrences(Integer.toString(1));
+ capabilityDefinition.setMaxOccurrences(Integer.toString(100));
+ capabilityDefinition.setType(ForwardingPathToscaUtil.FORWARDS_TO_TOSCA_NAME);
+ capabilityDefinition.setName(name);
+ capabilityDefinition.setUniqueId(name);
+ capabilityDefinition.setPath(Arrays.asList("Just", "something", "to", "read"));
+ capabiltiesMap.put(capabilityDefinition.getName(), Collections.singletonList(capabilityDefinition));
+ componentInstance.setCapabilities(capabiltiesMap);
+ Resource resource = new Resource();
+ resource.setToscaResourceName("test");
+ originComponents.put(uuid, resource);
+ return componentInstance;
+ }
+
+ @Test
+ public void singleElementPath() {
+ Assertions.assertDoesNotThrow(() -> {
+ createPathSingleElement();
+ Map<String, ToscaNodeTemplate> nodeTemplatesRes = new HashMap<>();
+
+ Map<String, ToscaNodeTemplate> expectedNodeTemplatesRes = new HashMap<>();
+ ToscaNodeTemplate pathEntry = new ToscaNodeTemplate();
+ pathEntry.setType(FORWARDING_PATH_TOSCA_TYPE);
+ Map<String, Object> expectedProps = new HashMap<>();
+ expectedProps.put(PORTS_RANGE, Collections.singletonList(PATH_1_PORTS));
+ expectedProps.put(PROTOCOL, PATH_1_PROTOCOL);
+ pathEntry.setProperties(expectedProps);
+ List<Map<String, ToscaTemplateRequirement>> requirements = new ArrayList<>();
+ ToscaTemplateRequirement firstEntryReq = new ToscaTemplateRequirement();
+ ToscaTemplateRequirement secondEntryReq = new ToscaTemplateRequirement();
+
+ firstEntryReq.setCapability("null." + NODE_NAME_1);
+ secondEntryReq.setCapability("null." + NODE_NAME_2);
+
+ firstEntryReq.setNode(NODE_NAME_1);
+ secondEntryReq.setNode(NODE_NAME_2);
+
+ firstEntryReq.setRelationship(FORWARDS_TO_TOSCA_NAME);
+ secondEntryReq.setRelationship(FORWARDS_TO_TOSCA_NAME);
+
+ Map<String, ToscaTemplateRequirement> entryMap1 = new HashMap<>();
+ Map<String, ToscaTemplateRequirement> entryMap2 = new HashMap<>();
+
+ entryMap1.put(FORWARDER, firstEntryReq);
+ entryMap2.put(FORWARDER, secondEntryReq);
+
+ requirements.add(entryMap1);
+ requirements.add(entryMap2);
+
+ pathEntry.setRequirements(requirements);
+ expectedNodeTemplatesRes.put(PATH_1_NAME, pathEntry);
+ addForwardingPaths(service, nodeTemplatesRes, capabiltyRequirementConvertor, originComponents, toscaOperationFacade);
+
+ assertEquals(2, nodeTemplatesRes.get(PATH_1_NAME).getRequirements().size());
+ compareToscaPathEntry(expectedNodeTemplatesRes, nodeTemplatesRes);
+ });
+ }
+
+ private void compareToscaPathEntry(Map<String, ToscaNodeTemplate> expectedNodeTemplatesRes,
+ Map<String, ToscaNodeTemplate> nodeTemplatesRes) {
+ final ToscaNodeTemplate expectedTemplate = expectedNodeTemplatesRes.get(PATH_1_NAME);
+ final ToscaNodeTemplate actualTemplate = nodeTemplatesRes.get(PATH_1_NAME);
+ assertEquals(expectedTemplate.getProperties(), actualTemplate.getProperties());
+ final int size = expectedTemplate.getRequirements().size();
+ assertEquals(size, actualTemplate.getRequirements().size());
+ for (int i = 0; i < size; i++) {
+ compareToscaRequirement(expectedTemplate, actualTemplate, i);
+ }
+ }
+
+ private void compareToscaRequirement(ToscaNodeTemplate expectedTemplate,
+ ToscaNodeTemplate actualTemplate,
+ int i) {
+ final ToscaTemplateRequirement actualRequirement = actualTemplate.getRequirements().get(i).get(FORWARDER);
+ final ToscaTemplateRequirement expectedToscaRequirement = expectedTemplate.getRequirements().get(i).get(FORWARDER);
+ assertEquals(actualRequirement.getCapability(), expectedToscaRequirement.getCapability());
+ assertEquals(actualRequirement.getNode(), expectedToscaRequirement.getNode());
+ }
+
+ private void createPathSingleElement() {
+ ForwardingPathElementDataDefinition element1 = initElement(NODE_NAME_1, NODE_NAME_2, NODE_NAME_1, NODE_NAME_2);
+
+ ListDataDefinition<ForwardingPathElementDataDefinition> list = new ListDataDefinition<>();
+ list.add(element1);
+
+ ForwardingPathDataDefinition path = new ForwardingPathDataDefinition();
+ path.setDescription(PATH_1_DESC);
+ path.setProtocol(PATH_1_PROTOCOL);
+ path.setDestinationPortNumber(PATH_1_PORTS);
+ path.setToscaResourceName(FORWARDING_PATH_TOSCA_TYPE);
+ path.setPathElements(list);
+ path.setName(PATH_1_NAME);
+
+ Map<String, ForwardingPathDataDefinition> paths = new HashMap<>();
+ paths.put(PATH_1_NAME, path);
+
+ service.setForwardingPaths(paths);
+ }
+
+ private ForwardingPathElementDataDefinition initElement(String fromId, String toId, String fromCP, String toCP) {
+ ForwardingPathElementDataDefinition element = new ForwardingPathElementDataDefinition();
+ element.setFromCP(fromCP);
+ element.setFromNode(fromId);
+ element.setToCP(toCP);
+ element.setToNode(toId);
+ return element;
+ }
+}
diff --git a/catalog-be/src/test/resources/paths/path-context.xml b/catalog-be/src/test/resources/paths/path-context.xml
index 752e4ecf13..53e8b8c74b 100644
--- a/catalog-be/src/test/resources/paths/path-context.xml
+++ b/catalog-be/src/test/resources/paths/path-context.xml
@@ -20,87 +20,67 @@ limitations under the License.
Modifications copyright (c) 2018 Nokia
================================================================================
-->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<beans xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
- <context:annotation-config/>
<aop:aspectj-autoproxy proxy-target-class="true"/>
-
+ <bean class="org.openecomp.sdc.be.dao.config.DAOSpringConfig"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.ForwardingPathToscaOperationFacade"
+ id="tosca-operation-facade"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.InMemoryJanusGraphClient"
+ id="janusgraph-client"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.ArtifactCassandraDaoMock"
+ id="artifact-cassandra-dao"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.AuditCassandraDaoMock"
+ id="audit-cassandra-dao"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.FeatureToggleDaoMock"
+ id="feature_toggle_dao"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.EnvironmentCassandraDaoMock"
+ id="operational-environment-dao"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.SdcSchemaFilesCassandraDaoMock"
+ id="sdc-schema-files-cassandra-dao"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.ToscaModelImportCassandraDaoMock"
+ id="tosca-model-import-cassandra-dao"/>
+ <bean class="org.openecomp.sdc.be.client.onboarding.impl.OnboardingClientImpl"
+ id="onboarding-client"/>
+ <bean class="org.openecomp.sdc.be.catalog.impl.DmaapProducer" id="dmaapProducer"/>
+ <bean class="org.openecomp.sdc.be.catalog.impl.DmaapProducerHealth" id="dmaapProducerHealth"/>
+ <bean class="org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic"
+ id="lifecycleBusinessLogic"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.DistributionEngineMock"
+ id="distributionEngine"/>
+ <bean class="org.openecomp.sdc.be.components.path.beans.ForwardingPathValidatorMock"
+ id="forwardingPathValidator"/>
+ <bean class="org.openecomp.sdc.be.components.attribute.AttributeDeclarationOrchestrator"
+ id="attributeDeclarationOrchestrator"/>
+ <bean
+ class="org.openecomp.sdc.be.components.attribute.ComponentInstanceOutputAttributeDeclarator"/>
+ <bean class="org.openecomp.sdc.be.components.attribute.ComponentInstanceAttributeDeclarator"/>
+ <context:annotation-config/>
<context:component-scan
- base-package="org.openecomp.sdc.be.dao.impl,
- org.openecomp.sdc.be.dao.neo4j,
- org.openecomp.sdc.be.model.operations.impl,
+ base-package="
+ org.openecomp.sdc.be.dao.janusgraph,
+ org.openecomp.sdc.be.model.jsonjanusgraph,
+ org.openecomp.sdc.be.model.operations.impl,
org.openecomp.sdc.be.model.cache,
- org.openecomp.sdc.be.dao.janusgraph,
org.openecomp.sdc.be.user,
- org.openecomp.sdc.be.impl,
- org.openecomp.sdc.be.auditing.impl,
org.openecomp.sdc.be.components.impl,
- org.openecomp.sdc.be.components.attribute,
org.openecomp.sdc.be.components.merge,
+ org.openecomp.sdc.be.datamodel.utils,
+ org.openecomp.sdc.be.components.distribution.engine,
org.openecomp.sdc.be.components.property,
- org.openecomp.sdc.be.components.distribution.engine,
org.openecomp.sdc.be.facade.operations,
- org.openecomp.sdc.be.distribution,
org.openecomp.sdc.be.components.validation,
- org.openecomp.sdc.be.switchover.detector,
- org.openecomp.sdc.be.tosca,
- org.openecomp.sdc.be.client,
- org.openecomp.sdc.be.model.operations.impl,
- org.openecomp.sdc.be.model.jsonjanusgraph.operations,
- org.openecomp.sdc.be.model.jsonjanusgraph.utils,
- org.openecomp.sdc.be.model.jsonjanusgraph.config,
+ org.openecomp.sdc.be.auditing.impl,
org.openecomp.sdc.be.components.csar,
- org.openecomp.sdc.be.datamodel.utils,
- org.openecomp.sdc.be.model.utils,
- org.openecomp.sdc.be.dao.jsongraph">
-
+ org.openecomp.sdc.be.impl,
+ org.openecomp.sdc.be.tosca,
+ org.openecomp.sdc.be.dao.impl">
</context:component-scan>
- <bean id="tosca-operation-facade"
- class="org.openecomp.sdc.be.components.path.beans.ForwardingPathToscaOperationFacade"/>
- <bean id="janusgraph-client"
- class="org.openecomp.sdc.be.components.path.beans.InMemoryJanusGraphClient"/>
- <bean id="lifecycleBusinessLogic"
- class="org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic"/>
- <bean id="userBusinessLogicExt" class="org.openecomp.sdc.be.user.UserBusinessLogicExt"/>
- <bean id="asset-metadata-utils"
- class="org.openecomp.sdc.be.ecomp.converters.AssetMetadataConverter"/>
- <bean class="org.openecomp.sdc.be.dao.config.DAOSpringConfig"/>
- <bean id="cassandra-client"
- class="org.openecomp.sdc.be.components.path.beans.CassandraClientMock"/>
- <bean id="audit-cassandra-dao"
- class="org.openecomp.sdc.be.components.path.beans.AuditCassandraDaoMock"/>
- <bean id="artifact-cassandra-dao"
- class="org.openecomp.sdc.be.components.path.beans.ArtifactCassandraDaoMock"/>
- <bean id="operational-environment-dao"
- class="org.openecomp.sdc.be.components.path.beans.EnvironmentCassandraDaoMock"/>
- <bean id="sdc-schema-files-cassandra-dao"
- class="org.openecomp.sdc.be.components.path.beans.SdcSchemaFilesCassandraDaoMock"/>
- <bean id="distributionEngine"
- class="org.openecomp.sdc.be.components.path.beans.DistributionEngineMock"/>
- <bean id="forwardingPathValidator"
- class="org.openecomp.sdc.be.components.path.beans.ForwardingPathValidatorMock"/>
- <bean id="dataTypeValidatorConverter"
- class="org.openecomp.sdc.be.model.tosca.validators.DataTypeValidatorConverter"/>
- <bean id="sdcSchemaUtils" class="org.openecomp.sdc.be.dao.cassandra.schema.SdcSchemaUtils"/>
- <bean id="dmaapProducer" class="org.openecomp.sdc.be.catalog.impl.DmaapProducer"/>
- <bean id="catalogOperation" class="org.openecomp.sdc.be.facade.operations.CatalogOperation"/>
- <bean id="userOperation" class="org.openecomp.sdc.be.facade.operations.UserOperation"/>
- <bean id="dmaapProducerHealth" class="org.openecomp.sdc.be.catalog.impl.DmaapProducerHealth"/>
- <bean id="feature_toggle_dao"
- class="org.openecomp.sdc.be.components.path.beans.FeatureToggleDaoMock"/>
- <bean id="tosca-model-import-cassandra-dao"
- class="org.openecomp.sdc.be.components.path.beans.ToscaModelImportCassandraDaoMock"/>
- <bean name="httpClient" class="org.apache.http.impl.client.HttpClients"
- factory-method="createDefault"/>
- <bean class="org.openecomp.sdc.be.components.attribute.AttributeDeclarationOrchestrator"/>
- <bean
- class="org.openecomp.sdc.be.components.attribute.ComponentInstanceOutputAttributeDeclarator"/>
- <bean class="org.openecomp.sdc.be.components.attribute.ComponentInstanceAttributeDeclarator"/>
</beans>