Fix Assert
[sdc.git] / catalog-be / pom.xml
index ff80105..cbaf209 100644 (file)
@@ -9,35 +9,73 @@
   <parent>
     <groupId>org.openecomp.sdc</groupId>
     <artifactId>sdc-main</artifactId>
-    <version>1.5.1-SNAPSHOT</version>
+    <version>1.7.0-SNAPSHOT</version>
   </parent>
 
   <properties>
     <java-hamcrest.version>2.0.0.0</java-hamcrest.version>
-    <swagger.version>2.0.8</swagger.version>
+    <swagger.version>2.1.1</swagger.version>
+    <swagger-ui.version>3.25.0</swagger-ui.version>
+    <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
+    <replacer.plugin.version>1.5.3</replacer.plugin.version>
   </properties>
 
   <dependencies>
+    <!--JUnit Jupiter Engine to depend on the JUnit5 engine and JUnit 5 API -->
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+      <version>${junitJupiter.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <!--JUnit Jupiter Engine to depend on the JUnit4 engine and JUnit 4 API  -->
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+      <version>${junitJupiter.version}</version>
+      <scope>test</scope>
+    </dependency>
+
+      <dependency>
+          <groupId>org.openecomp.sdc</groupId>
+          <artifactId>togglz-rest-services</artifactId>
+          <version>${project.version}</version>
+      </dependency>
+
+      <dependency>
+          <groupId>com.rabbitmq</groupId>
+          <artifactId>amqp-client</artifactId>
+          <version>3.3.1</version>
+      </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>
-      <scope>compile</scope>
+      <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>
-      <scope>compile</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.openecomp.sdc</groupId>
-      <artifactId>security-utils</artifactId>
-      <version>${project.version}</version>
-      <scope>compile</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-core</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
 
     <dependency>
     </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>
       <groupId>org.openecomp.sdc</groupId>
       <artifactId>common-app-api</artifactId>
       <version>${project.version}</version>
-      <scope>compile</scope>
+      <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>
     </dependency>
+    <dependency>
+      <groupId>org.openecomp.sdc.be</groupId>
+      <artifactId>common-be</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.openecomp.sdc.be</groupId>
       <artifactId>catalog-dao</artifactId>
       <version>${project.version}</version>
-      <scope>compile</scope>
+      <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>
-      <scope>compile</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-core</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
 
     <dependency>
       <groupId>org.glassfish.jersey.media</groupId>
       <artifactId>jersey-media-json-jackson</artifactId>
       <version>${jersey-bom.version}</version>
-      <scope>compile</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-core</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
 
     <dependency>
       <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>
 
     <dependency>
       <groupId>org.janusgraph</groupId>
-      <artifactId>janusgraph-cassandra</artifactId>
+      <artifactId>janusgraph-cql</artifactId>
       <version>${janusgraph.version}</version>
       <scope>compile</scope>
       <exclusions>
           <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>
 
     </dependency>
 
-    <dependency>
-      <groupId>org.elasticsearch</groupId>
-      <artifactId>elasticsearch</artifactId>
-      <version>${elastic-search.version}</version>
-      <scope>compile</scope>
-    </dependency>
-
     <!-- functional java -->
     <dependency>
       <groupId>org.functionaljava</groupId>
       <version>${cassandra.driver.version}</version>
       <scope>compile</scope>
     </dependency>
-    <dependency>
-      <groupId>org.apache.thrift</groupId>
-      <artifactId>libthrift</artifactId>
-      <version>${libthrift.version}</version>
-    </dependency>
     <!-- CASSANDRA END -->
 
     <!-- Inserted for ECOMP Portal Integration -->
           <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>
       </exclusions>
     </dependency>
 
           <groupId>com.att.aft</groupId>
           <artifactId>dme2</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-core</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
       <scope>provided</scope>
     </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>
+      </exclusions>
+    </dependency>
+
     <!-- TEST -->
     <dependency>
       <groupId>org.assertj</groupId>
     </dependency>
 
     <dependency>
-      <groupId>com.github.tomakehurst</groupId>
-      <artifactId>wiremock-standalone</artifactId>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-webapp</artifactId>
+      <version>${jetty.version}</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
-      <groupId>org.eclipse.jetty</groupId>
-      <artifactId>jetty-webapp</artifactId>
-      <version>${jetty.version}</version>
+      <groupId>org.hamcrest</groupId>
+      <artifactId>hamcrest</artifactId>
+      <version>${hamcrest.version}</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>${junit.version}</version>
+      <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-core</artifactId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <version>${mockitoJupiter.version}</version>
       <scope>test</scope>
     </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>
 
       <scope>test</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.hamcrest</groupId>
-      <artifactId>java-hamcrest</artifactId>
-      <version>${java-hamcrest.version}</version>
-      <scope>test</scope>
-    </dependency>
-
     <dependency>
       <groupId>org.codehaus.groovy</groupId>
       <artifactId>groovy</artifactId>
       <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>jackson-mapper-asl</artifactId>
       <version>${jackson.mapper.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.onap.sdc.sdc-be-common</groupId>
+      <artifactId>security-util-lib</artifactId>
+      <version>${security.util.lib.version}</version>
+    </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>
+      </exclusions>
+    </dependency>
   </dependencies>
 
   <build>
-
     <finalName>${project.artifactId}-${project.version}</finalName>
-
     <plugins>
+      <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>
               <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
             </manifest>
           </archive>
-
-          <webResources>
+          <attachClasses>true</attachClasses>
+          <webResources combine.children="append">
             <resource>
-              <directory>src/main/resources</directory>
-              <directory>src/main/resources/swagger</directory>
+              <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>
-          <attachClasses>true</attachClasses>
         </configuration>
       </plugin>
       <plugin>
                     <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>
         <executions>
           <execution>
             <id>normatives</id>
-            <phase>package</phase>
+            <phase>prepare-package</phase>
             <goals>
               <goal>single</goal>
             </goals>
               <finalName>normatives</finalName>
               <appendAssemblyId>false</appendAssemblyId>
               <descriptors>
-                <descriptor>${project.basedir}/normatives.xml</descriptor>
+                <descriptor>src/main/assembly/normatives.xml</descriptor>
               </descriptors>
             </configuration>
           </execution>
                   </directory>
                   <followSymlinks>false</followSymlinks>
                   <includes>
+                    <include>Artifact-Generator.properties</include>
                     <include>error-configuration.yaml</include>
                     <include>ecomp-error-configuration.yaml</include>
                     <include>logback.xml</include>
                   <followSymlinks>false</followSymlinks>
                   <includes>
                     <include>*.war</include>
+                    <include>context.xml</include>
                   </includes>
                 </fileset>
                 <fileset>
-                  <directory>
-                    ${project.basedir}/sdc-backend-init/chef-repo/cookbooks/sdc-normatives/files/default
-                  </directory>
+                  <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>
-
           <execution>
             <id>clean-static-files</id>
             <phase>clean</phase>
                   <directory>${project.parent.basedir}/catalog-be/src/main/resources/config
                   </directory>
                   <includes>
+                    <include>Artifact-Generator.properties</include>
                     <include>error-configuration.yaml</include>
                     <include>ecomp-error-configuration.yaml</include>
                     <include>logback.xml</include>
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>com.github.kongchen</groupId>
-        <artifactId>swagger-maven-plugin</artifactId>
-        <version>3.1.0</version>
-        <configuration>
-          <apiSources>
-            <apiSource>
-              <springmvc>false</springmvc>
-              <schemes>http</schemes>
-              <basePath>/sdc</basePath>
-              <locations>
-                io.swagger.jaxrs.json;org.openecomp.sdc.be.externalapi.servlet;org.openecomp.sdc.be.distribution.servlet;org.openecomp.normative.api
-              </locations>
-              <info>
-                <title>External Rest API</title>
-                <version>v1.0</version>
-                <description>External Rest API Documentation</description>
-                <termsOfService>
-                  http://www.github.com/kongchen/swagger-maven-plugin
-                </termsOfService>
-              </info>
-              <templatePath>${basedir}/templates/strapdown.html.hbs</templatePath>
-              <outputPath>${basedir}/target/generated/swagger-ui/api.html</outputPath>
-              <swaggerDirectory>${basedir}/target/generated/swagger-ui
-              </swaggerDirectory>
-              <swaggerApiReader>io.swagger.jaxrs.config.DefaultJaxrsConfig</swaggerApiReader>
-            </apiSource>
-          </apiSources>
-        </configuration>
-        <executions>
-          <execution>
-            <phase>compile</phase>
-            <goals>
-              <goal>generate</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
 
     <pluginManagement>
                       <goal>wget</goal>
                     </goals>
                   </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
                 </pluginExecution>
 
                 <pluginExecution>
       </activation>
       <build>
         <plugins>
+          <plugin>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.8</version>
+            <executions>
+              <execution>
+                <id>copy-context-file</id>
+                <phase>validate</phase>
+                <configuration>
+                  <target>
+                    <copy file="sdc-backend/context.xml.template" tofile="sdc-backend/context.xml"
+                      overwrite="true"/>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>set-version-in-context-file</id>
+                <phase>generate-resources</phase>
+                <configuration>
+                  <target>
+                    <replace file="sdc-backend/context.xml">
+                      <replacetoken>projectversion</replacetoken>
+                      <replacevalue>${project.version}</replacevalue>
+                    </replace>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-resources-plugin</artifactId>
             <executions>
               <execution>
-                <id>copy-resources-apidocs</id>
+                <id>copy-resources-be</id>
                 <phase>verify</phase>
                 <goals>
                   <goal>copy-resources</goal>
                   <outputDirectory>${basedir}/sdc-backend</outputDirectory>
                   <resources>
                     <resource>
-                      <directory>
-                        ${project.parent.basedir}/openecomp-be/tools/swagger-ui/target/api-docs
-                      </directory>
+                      <directory>${project.parent.basedir}/catalog-be/target</directory>
                       <includes>
-                        <include>api-docs.war</include>
+                        <include>catalog-be-${project.version}.war</include>
                       </includes>
                     </resource>
                   </resources>
                 </configuration>
               </execution>
-
               <execution>
-                <id>copy-resources-be</id>
-                <phase>verify</phase>
+                <id>copy-normatives</id>
+                <phase>package</phase>
                 <goals>
                   <goal>copy-resources</goal>
                 </goals>
                 <configuration>
-                  <outputDirectory>${basedir}/sdc-backend</outputDirectory>
+                  <outputDirectory>
+                    sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/files/default
+                  </outputDirectory>
                   <resources>
                     <resource>
                       <directory>${project.parent.basedir}/catalog-be/target</directory>
                       <includes>
-                        <include>catalog-be-${project.version}.war</include>
-                      </includes>
-                    </resource>
-                    <resource>
-                      <directory>
-                        ${project.parent.basedir}/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/target
-                      </directory>
-                      <includes>
-                        <include>onboarding-be-${project.version}.war</include>
+                        <include>normatives.tar.gz</include>
                       </includes>
                     </resource>
                   </resources>
                 </configuration>
               </execution>
               <execution>
-                <id>copy-normatives</id>
+                <id>copy-sdc-be-py</id>
                 <phase>verify</phase>
                 <goals>
                   <goal>copy-resources</goal>
                 </goals>
                 <configuration>
                   <outputDirectory>
-                    sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/files/default
+                    sdc-backend-init/
                   </outputDirectory>
                   <resources>
                     <resource>
-                      <directory>${project.parent.basedir}/catalog-be/target</directory>
+                      <directory>${project.parent.basedir}/catalog-be/src/main/resources/</directory>
                       <includes>
-                        <include>normatives.tar.gz</include>
+                        <include>scripts/sdcBePy/**</include>
+                        <inculde>scripts/setup.py</inculde>
                       </includes>
                     </resource>
                   </resources>
       </build>
     </profile>
   </profiles>
-</project>
\ No newline at end of file
+</project>