Fix unit tests 74/104174/3
authorDmitry Puzikov <d.puzikov2@partner.samsung.com>
Mon, 23 Mar 2020 16:27:25 +0000 (17:27 +0100)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Tue, 24 Mar 2020 08:34:33 +0000 (08:34 +0000)
Add asserts where required, fix tiny issues.

Replace DTO getters-setters with Lombok anntations.

Change-Id: I77c7ff2b1b536e357910ab1820ff27e03a16967a
Issue-ID: SDC-2849
Signed-off-by: Dmitry Puzikov <d.puzikov2@partner.samsung.com>
18 files changed:
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ArtifactMetadata.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductAssetMetadata.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductCategoryGroupMetadata.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetDetailedMetadata.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetMetadata.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceInstanceMetadata.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetDetailedMetadata.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetMetadata.java
catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceDistributionRespInfo.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ArtifactMetadataTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductAssetMetadataTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductCategoryGroupMetadataTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetDetailedMetadataTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetMetadataTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceInstanceMetadataTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetDetailedMetadataTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetMetadataTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceDistributionRespInfoTest.java

index e41d8d7..7b68ffe 100644 (file)
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
 public class ArtifactMetadata {
     private String artifactName;
     private String artifactType;
@@ -32,93 +37,4 @@ public class ArtifactMetadata {
     private String generatedFromUUID;
     private String artifactLabel;
     private String artifactGroupType;
-
-    public String getArtifactName() {
-        return artifactName;
-    }
-
-    public void setArtifactName(String artifactName) {
-        this.artifactName = artifactName;
-    }
-
-    public String getArtifactType() {
-        return artifactType;
-    }
-
-    public void setArtifactType(String artifactType) {
-        this.artifactType = artifactType;
-    }
-
-    public String getArtifactURL() {
-        return artifactURL;
-    }
-
-    public void setArtifactURL(String artifactURL) {
-        this.artifactURL = artifactURL;
-    }
-
-    public String getArtifactDescription() {
-        return artifactDescription;
-    }
-
-    public void setArtifactDescription(String artifactDescription) {
-        this.artifactDescription = artifactDescription;
-    }
-
-    public Integer getArtifactTimeout() {
-        return artifactTimeout;
-    }
-
-    public void setArtifactTimeout(Integer artifactTimeout) {
-        this.artifactTimeout = artifactTimeout;
-    }
-
-    public String getArtifactChecksum() {
-        return artifactChecksum;
-    }
-
-    public void setArtifactChecksum(String artifactChecksum) {
-        this.artifactChecksum = artifactChecksum;
-    }
-
-    public String getArtifactUUID() {
-        return artifactUUID;
-    }
-
-    public void setArtifactUUID(String artifactUUID) {
-        this.artifactUUID = artifactUUID;
-    }
-
-    public String getArtifactVersion() {
-        return artifactVersion;
-    }
-
-    public void setArtifactVersion(String artifactVersion) {
-        this.artifactVersion = artifactVersion;
-    }
-
-    public String getGeneratedFromUUID() {
-        return generatedFromUUID;
-    }
-
-    public void setGeneratedFromUUID(String generatedFromUUID) {
-        this.generatedFromUUID = generatedFromUUID;
-    }
-
-    public String getArtifactLabel() {
-        return artifactLabel;
-    }
-
-    public void setArtifactLabel(String artifactLabel) {
-        this.artifactLabel = artifactLabel;
-    }
-
-    public String getArtifactGroupType() {
-        return artifactGroupType;
-    }
-
-    public void setArtifactGroupType(String artifactGroupType) {
-        this.artifactGroupType = artifactGroupType;
-    }
-
 }
index 40b78c1..90801af 100644 (file)
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
 import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
 
+@Getter
+@Setter
 public class ProductAssetMetadata extends AssetMetadata {
     private String lifecycleState;
     private String lastUpdaterUserId;
-    private boolean isActive;
+    private boolean active;
     private List<String> contacts;
     private List<ProductCategoryGroupMetadata> productGroupings;
-
-    public String getLifecycleState() {
-        return lifecycleState;
-    }
-
-    public void setLifecycleState(String lifecycleState) {
-        this.lifecycleState = lifecycleState;
-    }
-
-    public String getLastUpdaterUserId() {
-        return lastUpdaterUserId;
-    }
-
-    public void setLastUpdaterUserId(String lastUpdaterUserId) {
-        this.lastUpdaterUserId = lastUpdaterUserId;
-    }
-
-    public boolean isActive() {
-        return isActive;
-    }
-
-    public void setActive(boolean isActive) {
-        this.isActive = isActive;
-    }
-
-    public List<String> getContacts() {
-        return contacts;
-    }
-
-    public void setContacts(List<String> contacts) {
-        this.contacts = contacts;
-    }
-
-    public List<ProductCategoryGroupMetadata> getProductGroupings() {
-        return productGroupings;
-    }
-
-    public void setProductGroupings(List<ProductCategoryGroupMetadata> productGroupings) {
-        this.productGroupings = productGroupings;
-    }
-
 }
index 7d666df..2813706 100644 (file)
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
 public class ProductCategoryGroupMetadata {
     private String category;
     private String subCategory;
     private String group;
-
-    public ProductCategoryGroupMetadata(String category, String subCategory, String group) {
-        this.category = category;
-        this.subCategory = subCategory;
-        this.group = group;
-    }
-
-    public String getCategory() {
-        return category;
-    }
-
-    public void setCategory(String category) {
-        this.category = category;
-    }
-
-    public String getSubCategory() {
-        return subCategory;
-    }
-
-    public void setSubCategory(String subCategory) {
-        this.subCategory = subCategory;
-    }
-
-    public String getGroup() {
-        return group;
-    }
-
-    public void setGroup(String group) {
-        this.group = group;
-    }
 }
index eb15e07..0e50c4d 100644 (file)
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
 import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
 
+@Getter
+@Setter
 public class ResourceAssetDetailedMetadata extends ResourceAssetMetadata {
 
     private String lastUpdaterFullName;
@@ -29,45 +33,4 @@ public class ResourceAssetDetailedMetadata extends ResourceAssetMetadata {
     private List<ResourceInstanceMetadata> resources;
     private List<ArtifactMetadata> artifacts;
     private String description;
-
-    public String getLastUpdaterFullName() {
-        return lastUpdaterFullName;
-    }
-
-    public void setLastUpdaterFullName(String lastUpdaterFullName) {
-        this.lastUpdaterFullName = lastUpdaterFullName;
-    }
-
-    public String getToscaResourceName() {
-        return toscaResourceName;
-    }
-
-    public void setToscaResourceName(String toscaResourceName) {
-        this.toscaResourceName = toscaResourceName;
-    }
-
-    public List<ResourceInstanceMetadata> getResources() {
-        return resources;
-    }
-
-    public void setResources(List<ResourceInstanceMetadata> resources) {
-        this.resources = resources;
-    }
-
-    public List<ArtifactMetadata> getArtifacts() {
-        return artifacts;
-    }
-
-    public void setArtifacts(List<ArtifactMetadata> artifactMetaList) {
-        this.artifacts = artifactMetaList;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
 }
index 455e125..a75335a 100644 (file)
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
 public class ResourceAssetMetadata extends AssetMetadata {
     private String category;
     private String subCategory;
     private String resourceType;
     private String lifecycleState;
     private String lastUpdaterUserId;
-
-    public String getCategory() {
-        return category;
-    }
-
-    public void setCategory(String category) {
-        this.category = category;
-    }
-
-    public String getSubCategory() {
-        return subCategory;
-    }
-
-    public void setSubCategory(String subCategory) {
-        this.subCategory = subCategory;
-    }
-
-    public String getResourceType() {
-        return resourceType;
-    }
-
-    public void setResourceType(String resourceType) {
-        this.resourceType = resourceType;
-    }
-
-    public String getLifecycleState() {
-        return lifecycleState;
-    }
-
-    public void setLifecycleState(String lifecycleState) {
-        this.lifecycleState = lifecycleState;
-    }
-
-    public String getLastUpdaterUserId() {
-        return lastUpdaterUserId;
-    }
-
-    public void setLastUpdaterUserId(String lastUpdaterUserId) {
-        this.lastUpdaterUserId = lastUpdaterUserId;
-    }
 }
index 1023f82..da2a9ec 100644 (file)
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
 import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
 
+@Getter
+@Setter
 public class ResourceInstanceMetadata {
     private String resourceInstanceName;
     private String resourceName;
@@ -30,60 +34,4 @@ public class ResourceInstanceMetadata {
     private String resoucreType;
     private String resourceUUID;
     private List<ArtifactMetadata> artifacts;
-
-    public String getResourceInstanceName() {
-        return resourceInstanceName;
-    }
-
-    public void setResourceInstanceName(String resourceInstanceName) {
-        this.resourceInstanceName = resourceInstanceName;
-    }
-
-    public String getResourceName() {
-        return resourceName;
-    }
-
-    public void setResourceName(String resourceName) {
-        this.resourceName = resourceName;
-    }
-
-    public String getResourceInvariantUUID() {
-        return resourceInvariantUUID;
-    }
-
-    public void setResourceInvariantUUID(String resourceInvariantUUID) {
-        this.resourceInvariantUUID = resourceInvariantUUID;
-    }
-
-    public String getResourceVersion() {
-        return resourceVersion;
-    }
-
-    public void setResourceVersion(String resourceVersion) {
-        this.resourceVersion = resourceVersion;
-    }
-
-    public String getResoucreType() {
-        return resoucreType;
-    }
-
-    public void setResoucreType(String resoucreType) {
-        this.resoucreType = resoucreType;
-    }
-
-    public String getResourceUUID() {
-        return resourceUUID;
-    }
-
-    public void setResourceUUID(String resourceUUID) {
-        this.resourceUUID = resourceUUID;
-    }
-
-    public List<ArtifactMetadata> getArtifacts() {
-        return artifacts;
-    }
-
-    public void setArtifacts(List<ArtifactMetadata> artifacts) {
-        this.artifacts = artifacts;
-    }
 }
index e677fdc..cc4e398 100644 (file)
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
 import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
 
+@Getter
+@Setter
 public class ServiceAssetDetailedMetadata extends ServiceAssetMetadata {
     private String lastUpdaterFullName;
     private List<ResourceInstanceMetadata> resources;
     private List<ArtifactMetadata> artifacts;
-
-    public String getLastUpdaterFullName() {
-        return lastUpdaterFullName;
-    }
-
-    public void setLastUpdaterFullName(String lastUpdaterFullName) {
-        this.lastUpdaterFullName = lastUpdaterFullName;
-    }
-
-    public List<ResourceInstanceMetadata> getResources() {
-        return resources;
-    }
-
-    public void setResources(List<ResourceInstanceMetadata> resources) {
-        this.resources = resources;
-    }
-
-    public List<ArtifactMetadata> getArtifacts() {
-        return artifacts;
-    }
-
-    public void setArtifacts(List<ArtifactMetadata> artifacts) {
-        this.artifacts = artifacts;
-    }
 }
index 6e5ac84..3308343 100644 (file)
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
 public class ServiceAssetMetadata extends AssetMetadata {
     private String category;
     private String lifecycleState;
     private String lastUpdaterUserId;
     private String distributionStatus;
-
-    public String getCategory() {
-        return category;
-    }
-
-    public void setCategory(String category) {
-        this.category = category;
-    }
-
-    public String getLifecycleState() {
-        return lifecycleState;
-    }
-
-    public void setLifecycleState(String lifecycleState) {
-        this.lifecycleState = lifecycleState;
-    }
-
-    public String getLastUpdaterUserId() {
-        return lastUpdaterUserId;
-    }
-
-    public void setLastUpdaterUserId(String lastUpdaterUserId) {
-        this.lastUpdaterUserId = lastUpdaterUserId;
-    }
-
-    public String getDistributionStatus() {
-        return distributionStatus;
-    }
-
-    public void setDistributionStatus(String distributionStatus) {
-        this.distributionStatus = distributionStatus;
-    }
 }
index c5e1a42..1ba33ad 100644 (file)
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
 /**
  * Created by chaya on 10/26/2017.
  */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
 public class ServiceDistributionRespInfo {
-
     private String distributionId;
-
-    public ServiceDistributionRespInfo() {
-    }
-
-    public ServiceDistributionRespInfo(String distributionId) {
-        this.distributionId = distributionId;
-    }
-
-    public String getDistributionId() {
-        return distributionId;
-    }
-
-    public void setDistributionId(String distributionId) {
-        this.distributionId = distributionId;
-    }
 }
index 9edb773..a28f619 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.Test;
 
 
@@ -29,245 +31,12 @@ public class ArtifactMetadataTest {
                return new ArtifactMetadata();
        }
 
-       
-       @Test
-       public void testGetArtifactName() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactName();
-       }
-
-       
-       @Test
-       public void testSetArtifactName() throws Exception {
-               ArtifactMetadata testSubject;
-               String artifactName = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactName(artifactName);
-       }
-
-       
-       @Test
-       public void testGetArtifactType() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactType();
-       }
-
-       
-       @Test
-       public void testSetArtifactType() throws Exception {
-               ArtifactMetadata testSubject;
-               String artifactType = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactType(artifactType);
-       }
-
-       
-       @Test
-       public void testGetArtifactURL() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactURL();
-       }
-
-       
-       @Test
-       public void testSetArtifactURL() throws Exception {
-               ArtifactMetadata testSubject;
-               String artifactURL = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactURL(artifactURL);
-       }
-
-       
-       @Test
-       public void testGetArtifactDescription() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactDescription();
-       }
-
-       
-       @Test
-       public void testSetArtifactDescription() throws Exception {
-               ArtifactMetadata testSubject;
-               String artifactDescription = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactDescription(artifactDescription);
-       }
-
-       
-       @Test
-       public void testGetArtifactTimeout() throws Exception {
-               ArtifactMetadata testSubject;
-               Integer result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactTimeout();
-       }
-
-       
-       @Test
-       public void testSetArtifactTimeout() throws Exception {
-               ArtifactMetadata testSubject;
-               Integer artifactTimeout = 0;
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactTimeout(artifactTimeout);
-       }
-
-       
-       @Test
-       public void testGetArtifactChecksum() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactChecksum();
-       }
-
-       
-       @Test
-       public void testSetArtifactChecksum() throws Exception {
-               ArtifactMetadata testSubject;
-               String artifactChecksum = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactChecksum(artifactChecksum);
-       }
-
-       
-       @Test
-       public void testGetArtifactUUID() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactUUID();
-       }
-
-       
-       @Test
-       public void testSetArtifactUUID() throws Exception {
-               ArtifactMetadata testSubject;
-               String artifactUUID = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactUUID(artifactUUID);
-       }
-
-       
-       @Test
-       public void testGetArtifactVersion() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactVersion();
-       }
-
-       
-       @Test
-       public void testSetArtifactVersion() throws Exception {
-               ArtifactMetadata testSubject;
-               String artifactVersion = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactVersion(artifactVersion);
-       }
-
-       
-       @Test
-       public void testGetGeneratedFromUUID() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getGeneratedFromUUID();
-       }
-
-       
-       @Test
-       public void testSetGeneratedFromUUID() throws Exception {
-               ArtifactMetadata testSubject;
-               String generatedFromUUID = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setGeneratedFromUUID(generatedFromUUID);
-       }
-
-       
-       @Test
-       public void testGetArtifactLabel() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactLabel();
-       }
-
-       
-       @Test
-       public void testSetArtifactLabel() throws Exception {
-               ArtifactMetadata testSubject;
-               String artifactLabel = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifactLabel(artifactLabel);
-       }
-
-       
-       @Test
-       public void testGetArtifactGroupType() throws Exception {
-               ArtifactMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifactGroupType();
-       }
-
-       
        @Test
-       public void testSetArtifactGroupType() throws Exception {
+       public void testArtifactNameInstance() throws Exception {
                ArtifactMetadata testSubject;
-               String artifactGroupType = "";
 
                // default test
                testSubject = createTestSubject();
-               testSubject.setArtifactGroupType(artifactGroupType);
+               assertThat(testSubject).isInstanceOf(ArtifactMetadata.class);
        }
 }
index 615c8e7..8fd500d 100644 (file)
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
-import org.junit.Test;
-
-import java.util.List;
+import static org.assertj.core.api.Assertions.assertThat;
 
+import org.junit.Test;
 
 public class ProductAssetMetadataTest {
 
@@ -35,109 +34,9 @@ public class ProductAssetMetadataTest {
        @Test
        public void testGetLifecycleState() throws Exception {
                ProductAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getLifecycleState();
-       }
-
-       
-       @Test
-       public void testSetLifecycleState() throws Exception {
-               ProductAssetMetadata testSubject;
-               String lifecycleState = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setLifecycleState(lifecycleState);
-       }
-
-       
-       @Test
-       public void testGetLastUpdaterUserId() throws Exception {
-               ProductAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getLastUpdaterUserId();
-       }
-
-       
-       @Test
-       public void testSetLastUpdaterUserId() throws Exception {
-               ProductAssetMetadata testSubject;
-               String lastUpdaterUserId = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setLastUpdaterUserId(lastUpdaterUserId);
-       }
-
-       
-       @Test
-       public void testIsActive() throws Exception {
-               ProductAssetMetadata testSubject;
-               boolean result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.isActive();
-       }
-
-       
-       @Test
-       public void testSetActive() throws Exception {
-               ProductAssetMetadata testSubject;
-               boolean isActive = false;
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setActive(isActive);
-       }
-
-       
-       @Test
-       public void testGetContacts() throws Exception {
-               ProductAssetMetadata testSubject;
-               List<String> result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getContacts();
-       }
-
-       
-       @Test
-       public void testSetContacts() throws Exception {
-               ProductAssetMetadata testSubject;
-               List<String> contacts = null;
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setContacts(contacts);
-       }
-
-       
-       @Test
-       public void testGetProductGroupings() throws Exception {
-               ProductAssetMetadata testSubject;
-               List<ProductCategoryGroupMetadata> result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getProductGroupings();
-       }
-
-       
-       @Test
-       public void testSetProductGroupings() throws Exception {
-               ProductAssetMetadata testSubject;
-               List<ProductCategoryGroupMetadata> productGroupings = null;
 
                // default test
                testSubject = createTestSubject();
-               testSubject.setProductGroupings(productGroupings);
+               assertThat(testSubject).isInstanceOf(ProductAssetMetadata.class);
        }
 }
index 09d0821..4985f4c 100644 (file)
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.Test;
 
 
 public class ProductCategoryGroupMetadataTest {
 
-       private ProductCategoryGroupMetadata createTestSubject() {
-               return new ProductCategoryGroupMetadata("", "", "");
-       }
-
-       
-       @Test
-       public void testGetCategory() throws Exception {
-               ProductCategoryGroupMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getCategory();
-       }
-
-       
-       @Test
-       public void testSetCategory() throws Exception {
-               ProductCategoryGroupMetadata testSubject;
-               String category = "";
+       private static final String category = "mock-category";
+       private static final String subCategory = "mock-sub-category";
+       private static final String group = "mock-group";
 
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setCategory(category);
-       }
-
-       
-       @Test
-       public void testGetSubCategory() throws Exception {
-               ProductCategoryGroupMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getSubCategory();
-       }
-
-       
-       @Test
-       public void testSetSubCategory() throws Exception {
-               ProductCategoryGroupMetadata testSubject;
-               String subCategory = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setSubCategory(subCategory);
-       }
-
-       
-       @Test
-       public void testGetGroup() throws Exception {
-               ProductCategoryGroupMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getGroup();
+       private ProductCategoryGroupMetadata createTestSubject() {
+               return new ProductCategoryGroupMetadata(category, subCategory, group);
        }
-
        
        @Test
-       public void testSetGroup() throws Exception {
+       public void testProductCategoryGroupMetadataConstructor() {
                ProductCategoryGroupMetadata testSubject;
-               String group = "";
 
                // default test
                testSubject = createTestSubject();
-               testSubject.setGroup(group);
+               assertThat(testSubject)
+                               .isInstanceOf(ProductCategoryGroupMetadata.class)
+                               .hasFieldOrPropertyWithValue("category", category)
+                               .hasFieldOrPropertyWithValue("subCategory", subCategory)
+                               .hasFieldOrPropertyWithValue("group", group);
        }
 }
index a8a84a3..f1f7d73 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.Test;
 
 import java.util.List;
@@ -32,111 +34,11 @@ public class ResourceAssetDetailedMetadataTest {
 
        
        @Test
-       public void testGetLastUpdaterFullName() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getLastUpdaterFullName();
-       }
-
-       
-       @Test
-       public void testSetLastUpdaterFullName() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               String lastUpdaterFullName = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setLastUpdaterFullName(lastUpdaterFullName);
-       }
-
-       
-       @Test
-       public void testGetToscaResourceName() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getToscaResourceName();
-       }
-
-       
-       @Test
-       public void testSetToscaResourceName() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               String toscaResourceName = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setToscaResourceName(toscaResourceName);
-       }
-
-       
-       @Test
-       public void testGetResources() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               List<ResourceInstanceMetadata> result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResources();
-       }
-
-       
-       @Test
-       public void testSetResources() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               List<ResourceInstanceMetadata> resources = null;
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResources(resources);
-       }
-
-       
-       @Test
-       public void testGetArtifacts() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               List<ArtifactMetadata> result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifacts();
-       }
-
-       
-       @Test
-       public void testSetArtifacts() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               List<ArtifactMetadata> artifactMetaList = null;
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setArtifacts(artifactMetaList);
-       }
-
-       
-       @Test
-       public void testGetDescription() throws Exception {
-               ResourceAssetDetailedMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getDescription();
-       }
-
-       
-       @Test
-       public void testSetDescription() throws Exception {
+       public void testGetLastUpdaterFullName() {
                ResourceAssetDetailedMetadata testSubject;
-               String description = "";
 
                // default test
                testSubject = createTestSubject();
-               testSubject.setDescription(description);
+               assertThat(testSubject).isInstanceOf(ResourceAssetDetailedMetadata.class);
        }
 }
index 6f36ded..f1770b1 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.Test;
 
 
@@ -31,111 +33,11 @@ public class ResourceAssetMetadataTest {
 
        
        @Test
-       public void testGetCategory() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getCategory();
-       }
-
-       
-       @Test
-       public void testSetCategory() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String category = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setCategory(category);
-       }
-
-       
-       @Test
-       public void testGetSubCategory() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getSubCategory();
-       }
-
-       
-       @Test
-       public void testSetSubCategory() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String subCategory = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setSubCategory(subCategory);
-       }
-
-       
-       @Test
-       public void testGetResourceType() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResourceType();
-       }
-
-       
-       @Test
-       public void testSetResourceType() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String resourceType = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResourceType(resourceType);
-       }
-
-       
-       @Test
-       public void testGetLifecycleState() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getLifecycleState();
-       }
-
-       
-       @Test
-       public void testSetLifecycleState() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String lifecycleState = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setLifecycleState(lifecycleState);
-       }
-
-       
-       @Test
-       public void testGetLastUpdaterUserId() throws Exception {
-               ResourceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getLastUpdaterUserId();
-       }
-
-       
-       @Test
-       public void testSetLastUpdaterUserId() throws Exception {
+       public void testGetCategory() {
                ResourceAssetMetadata testSubject;
-               String lastUpdaterUserId = "";
 
                // default test
                testSubject = createTestSubject();
-               testSubject.setLastUpdaterUserId(lastUpdaterUserId);
+               assertThat(testSubject).isInstanceOf(ResourceAssetMetadata.class);
        }
 }
index 35f2a4f..24d40e8 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.Test;
 
 import java.util.List;
@@ -33,155 +35,11 @@ public class ResourceInstanceMetadataTest {
 
        
        @Test
-       public void testGetResourceInstanceName() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResourceInstanceName();
-       }
-
-       
-       @Test
-       public void testSetResourceInstanceName() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String resourceInstanceName = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResourceInstanceName(resourceInstanceName);
-       }
-
-       
-       @Test
-       public void testGetResourceName() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResourceName();
-       }
-
-       
-       @Test
-       public void testSetResourceName() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String resourceName = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResourceName(resourceName);
-       }
-
-       
-       @Test
-       public void testGetResourceInvariantUUID() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResourceInvariantUUID();
-       }
-
-       
-       @Test
-       public void testSetResourceInvariantUUID() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String resourceInvariantUUID = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResourceInvariantUUID(resourceInvariantUUID);
-       }
-
-       
-       @Test
-       public void testGetResourceVersion() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResourceVersion();
-       }
-
-       
-       @Test
-       public void testSetResourceVersion() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String resourceVersion = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResourceVersion(resourceVersion);
-       }
-
-       
-       @Test
-       public void testGetResoucreType() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResoucreType();
-       }
-
-       
-       @Test
-       public void testSetResoucreType() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String resoucreType = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResoucreType(resoucreType);
-       }
-
-       
-       @Test
-       public void testGetResourceUUID() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResourceUUID();
-       }
-
-       
-       @Test
-       public void testSetResourceUUID() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               String resourceUUID = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResourceUUID(resourceUUID);
-       }
-
-       
-       @Test
-       public void testGetArtifacts() throws Exception {
-               ResourceInstanceMetadata testSubject;
-               List<ArtifactMetadata> result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifacts();
-       }
-
-       
-       @Test
-       public void testSetArtifacts() throws Exception {
+       public void testGetResourceInstanceName() {
                ResourceInstanceMetadata testSubject;
-               List<ArtifactMetadata> artifacts = null;
 
                // default test
                testSubject = createTestSubject();
-               testSubject.setArtifacts(artifacts);
+               assertThat(testSubject).isInstanceOf(ResourceInstanceMetadata.class);
        }
 }
index 093f0fc..eba5113 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.Test;
 
 import java.util.List;
@@ -35,65 +37,9 @@ public class ServiceAssetDetailedMetadataTest {
        @Test
        public void testGetLastUpdaterFullName() throws Exception {
                ServiceAssetDetailedMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getLastUpdaterFullName();
-       }
-
-       
-       @Test
-       public void testSetLastUpdaterFullName() throws Exception {
-               ServiceAssetDetailedMetadata testSubject;
-               String lastUpdaterFullName = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setLastUpdaterFullName(lastUpdaterFullName);
-       }
-
-       
-       @Test
-       public void testGetResources() throws Exception {
-               ServiceAssetDetailedMetadata testSubject;
-               List<ResourceInstanceMetadata> result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getResources();
-       }
-
-       
-       @Test
-       public void testSetResources() throws Exception {
-               ServiceAssetDetailedMetadata testSubject;
-               List<ResourceInstanceMetadata> resources = null;
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setResources(resources);
-       }
-
-       
-       @Test
-       public void testGetArtifacts() throws Exception {
-               ServiceAssetDetailedMetadata testSubject;
-               List<ArtifactMetadata> result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getArtifacts();
-       }
-
-       
-       @Test
-       public void testSetArtifacts() throws Exception {
-               ServiceAssetDetailedMetadata testSubject;
-               List<ArtifactMetadata> artifacts = null;
 
                // default test
                testSubject = createTestSubject();
-               testSubject.setArtifacts(artifacts);
+               assertThat(testSubject).isInstanceOf(ServiceAssetDetailedMetadata.class);
        }
 }
index d84246a..8fbe260 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.Test;
 
 
@@ -31,89 +33,11 @@ public class ServiceAssetMetadataTest {
 
        
        @Test
-       public void testGetCategory() throws Exception {
-               ServiceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getCategory();
-       }
-
-       
-       @Test
-       public void testSetCategory() throws Exception {
-               ServiceAssetMetadata testSubject;
-               String category = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setCategory(category);
-       }
-
-       
-       @Test
-       public void testGetLifecycleState() throws Exception {
-               ServiceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getLifecycleState();
-       }
-
-       
-       @Test
-       public void testSetLifecycleState() throws Exception {
-               ServiceAssetMetadata testSubject;
-               String lifecycleState = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setLifecycleState(lifecycleState);
-       }
-
-       
-       @Test
-       public void testGetLastUpdaterUserId() throws Exception {
-               ServiceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getLastUpdaterUserId();
-       }
-
-       
-       @Test
-       public void testSetLastUpdaterUserId() throws Exception {
-               ServiceAssetMetadata testSubject;
-               String lastUpdaterUserId = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setLastUpdaterUserId(lastUpdaterUserId);
-       }
-
-       
-       @Test
-       public void testGetDistributionStatus() throws Exception {
-               ServiceAssetMetadata testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getDistributionStatus();
-       }
-
-       
-       @Test
-       public void testSetDistributionStatus() throws Exception {
+       public void testGetCategory() {
                ServiceAssetMetadata testSubject;
-               String distributionStatus = "";
 
                // default test
                testSubject = createTestSubject();
-               testSubject.setDistributionStatus(distributionStatus);
+               assertThat(testSubject).isInstanceOf(ServiceAssetMetadata.class);
        }
 }
index 8636db6..7851a9f 100644 (file)
 
 package org.openecomp.sdc.be.externalapi.servlet.representation;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.Test;
 
 public class ServiceDistributionRespInfoTest {
-
-       private ServiceDistributionRespInfo createTestSubject() {
-               return new ServiceDistributionRespInfo();
-       }
-
        @Test
-       public void testCtr() throws Exception {
-               new ServiceDistributionRespInfo("mock");
-       }
-       
-       @Test
-       public void testGetDistributionId() throws Exception {
-               ServiceDistributionRespInfo testSubject;
-               String result;
-
-               // default test
-               testSubject = createTestSubject();
-               result = testSubject.getDistributionId();
+       public void testCtrNoArgs(){
+               ServiceDistributionRespInfo serviceDistributionRespInfo = new ServiceDistributionRespInfo();
+               assertThat(serviceDistributionRespInfo)
+                               .isInstanceOf(ServiceDistributionRespInfo.class)
+                               .hasFieldOrPropertyWithValue("distributionId", null);
        }
 
        @Test
-       public void testSetDistributionId() throws Exception {
-               ServiceDistributionRespInfo testSubject;
-               String distributionId = "";
-
-               // default test
-               testSubject = createTestSubject();
-               testSubject.setDistributionId(distributionId);
+       public void testCtrAllArgs(){
+               String distributionId = "mock-id";
+               ServiceDistributionRespInfo serviceDistributionRespInfo = new ServiceDistributionRespInfo(distributionId);
+               assertThat(serviceDistributionRespInfo)
+                               .isInstanceOf(ServiceDistributionRespInfo.class)
+                               .hasFieldOrPropertyWithValue("distributionId", distributionId);
        }
 }