diff options
9 files changed, 155 insertions, 20 deletions
diff --git a/deliveries/src/main/docker/docker-files/docker-compose.yml b/deliveries/src/main/docker/docker-files/docker-compose.yml index 508867a7..48670e1b 100755 --- a/deliveries/src/main/docker/docker-files/docker-compose.yml +++ b/deliveries/src/main/docker/docker-files/docker-compose.yml @@ -1,14 +1,26 @@ -version: '2'
+version: '3.1'
+
services:
- vid-server:
- image: onap/vid
- ports:
- - "8080:8080"
- links:
- - vid-mariadb:vid-mariadb-docker-instance
- vid-mariadb:
- image: mariadb:10.1.11
- ports:
- - "3306:3306"
- volumes:
- - /var/lib/mysql
+ vid-server:
+ image: nexus3.onap.org:10001/onap/vid
+ ports:
+ - "8080:8080"
+ links:
+ - vid-mariadb:vid-mariadb-docker-instance
+ environment:
+ VID_MYSQL_DBNAME: vid_openecomp_epsdk
+ VID_MYSQL_PASS: YOUR_PASSWORD
+
+ vid-mariadb:
+ image: mariadb:10
+ ports:
+ - "3306:3306"
+ volumes:
+ - ../../../../../lf_config/vid-my.cnf:/etc/mysql/my.cnf
+ - ../../../../../lf_config/vid-pre-init.sql:/docker-entrypoint-initdb.d/vid-pre-init.sql
+ - /var/lib/mysql
+ environment:
+ MYSQL_DATABASE: vid_openecomp_epsdk
+ MYSQL_USER: vidadmin
+ MYSQL_PASSWORD: YOUR_PASSWORD
+ MYSQL_ROOT_PASSWORD: ROOT_PASSWORD
\ No newline at end of file diff --git a/docs/installation.rst b/docs/installation.rst index 54415add..f761c6af 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -29,3 +29,8 @@ Please follow the instructions given below, for installing VID using a Docker im #start VID server docker run -e VID_MYSQL_DBNAME=vid_openecomp_epsdk -e VID_MYSQL_PASS=YOUR_PASSWORD --name vid-server -p 8080:8080 --link vid-mariadb:vid-mariadb-docker-instance -d nexus3.onap.org:10001/onap/vid:1.2.1 +Or use docker-compose: + +.. code-block:: bash + + docker-compose up
\ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponseTranslator.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponseTranslator.java index 6f503799..c7a98a8c 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponseTranslator.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponseTranslator.java @@ -61,7 +61,7 @@ public class AaiResponseTranslator { final String errorMessage = aaiResponse.getErrorMessage(); return Optional.of(new PortMirroringConfigDataError( "Got " + aaiResponse.getHttpCode() + " from aai", - errorMessage != null ? errorMessage.toString() : null) + errorMessage != null ? errorMessage : null) ); } else { return Optional.empty(); diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java index d7f9ad87..aab9fc6b 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java @@ -13,7 +13,7 @@ import java.util.List; public class SubscriberListWithFilterData { public SubscriberListWithFilterData(SubscriberList subscriberList, RoleValidator roleValidator){ - List<Subscriber> subscribers = subscriberList != null ? subscriberList.customer : new ArrayList<Subscriber>(); + List<Subscriber> subscribers = subscriberList != null ? subscriberList.customer : new ArrayList<>(); List<SubscriberWithFilter> subscribersWithFilter = new ArrayList<>(); for (Subscriber subscriber :subscribers){ SubscriberWithFilter subscriberWithFilter = new SubscriberWithFilter(); diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetailsHelper.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetailsHelper.java index 2d3cfb91..cb3e548d 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetailsHelper.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetailsHelper.java @@ -14,7 +14,7 @@ public class AaiGetNetworkCollectionDetailsHelper { @JsonProperty("results") private List<Object> results = null; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + private Map<String, Object> additionalProperties = new HashMap<>(); @JsonProperty("results") public List<Object> getResults() { diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java index cd8cca8f..fa9fe935 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java @@ -20,7 +20,7 @@ public class AaiGetPnfResponse { @JsonProperty("results") public List<PnfResult> results = null; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + private Map<String, Object> additionalProperties = new HashMap<>(); @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { diff --git a/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java b/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java index 964c7e13..65fc5217 100644 --- a/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java @@ -60,8 +60,9 @@ public class FnAppDoaImpl { if( url!=null && username!=null && password!=null ){ con = DriverManager.getConnection(url, username, password); } - - System.out.println("Connection Successful"); + + logger.info("Connection Successful"); + return con; } diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java index 6f5f4f73..c34bf4e6 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java @@ -177,7 +177,10 @@ public class CsvServiceImpl implements CsvService{ currentJson.put(new JSONObject().put(key, values)); } else { JSONObject lastItem = lastItemInArray(currentJson); - lastItem.put(key, values); + if(lastItem != null){ + lastItem.put(key, values); + } + } } } diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ServiceTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ServiceTest.java new file mode 100644 index 00000000..4fb38a6b --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ServiceTest.java @@ -0,0 +1,114 @@ +package org.onap.vid.asdc.beans; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.Collection; + +import org.junit.After; +import org.junit.Test; + +public class ServiceTest { + + private Service service; + private Service.LifecycleState lifecycleState; + private Collection<Artifact> artifacts; + private Collection<SubResource> resources; + + + @org.junit.Before + public void setup() { + service = new Service(); + } + + @Test + public void testGetName_shouldNotNull() { + service.setName("service1"); + String result = service.getName(); + assertNotNull(result); + + } + + @Test + public void testGetVersion_shouldNotNull() { + + service.setVersion("version"); + String result = service.getVersion(); + assertNotNull(result); + } + + @Test + public void testLifeCycleState_shouldNotNull() { + service.setLifecycleState(Service.LifecycleState.CERTIFICATION_IN_PROGRESS); + Service.LifecycleState result = service.getLifecycleState(); + assertNotNull(result); + } + + @Test + public void getToscaModelURL_shouldNotNull() { + service.setToscaModelURL("URL"); + String result = service.getToscaModelURL(); + assertNotNull(result); + } + + + @Test + public void getCategory_shouldNotNull() { + service.setCategory("category"); + String result = service.getCategory(); + assertNotNull(result); + } + + @Test + public void getLastUpdaterUserId_shouldNotNull() { + service.set("lastUpdaterUserId"); + String result = service.getLastUpdaterUserId(); + assertNotNull(result); + } + + @Test + public void getLastUpdaterFullName_shouldNotNull() { + service.setLastUpdaterFullName("lastUpdaterFullName"); + String result = service.getLastUpdaterFullName(); + assertNotNull(result); + } + + + @Test + public void getDistributionStatus_shouldNotNull() { + service.setDistributionStatus("distributionStatus"); + String result = service.getDistributionStatus(); + assertNotNull(result); + } + + @Test + public void getArtifacts_shouldNotNull() { + artifacts = new ArrayList<>(); + Artifact artifact = new Artifact(); + artifact.setArtifactDescription("artifactDescription"); + artifacts.add(artifact); + service.setArtifacts(artifacts); + Collection<Artifact> result = service.getArtifacts(); + assertNotNull(result); + } + + @Test + public void getResources_shouldNotNull() { + artifacts = new ArrayList<>(); + Artifact artifact = new Artifact(); + artifact.setArtifactDescription("artifactDescription"); + resources = new ArrayList<>(); + SubResource subResource = new SubResource(); + subResource.setArtifacts(artifacts); + service.setResources(resources); + assertNotNull(service.getResources()); + } + + + @After + public void tearDown() { + service = null; + lifecycleState = null; + } +} + |