aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/model
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-01-10 12:42:59 +0000
committerGerrit Code Review <gerrit@onap.org>2019-01-10 12:42:59 +0000
commit659874df80409170e57b6dd6197eb3a81eb3468e (patch)
tree08e79fd57aa0ed299586fd88f69f87a5a2f5ded1 /vid-app-common/src/test/java/org/onap/vid/model
parent143784a849ece4fc35cc290e33f829b72bf1fc79 (diff)
parent6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 (diff)
Merge "Merge from ECOMP's repository"
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/model')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/model/JobAuditStatusTest.java40
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/model/RequestReferencesContainerTest.java6
2 files changed, 43 insertions, 3 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/JobAuditStatusTest.java b/vid-app-common/src/test/java/org/onap/vid/model/JobAuditStatusTest.java
new file mode 100644
index 00000000..26db161d
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/JobAuditStatusTest.java
@@ -0,0 +1,40 @@
+package org.onap.vid.model;
+
+import org.apache.commons.lang3.StringUtils;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.util.Date;
+import java.util.UUID;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public class JobAuditStatusTest {
+
+ @DataProvider
+ public static Object[][] AdditionalInfoSizes() {
+ return new Object[][]{
+ {5, 5},
+ {1999,1999},
+ {2000, 2000},
+ {2001, 2000},
+ {10000, 2000}
+ };
+ }
+
+ @Test(dataProvider = "AdditionalInfoSizes")
+ public void testAdditionalInfoMaxLength(int originalSize, int finalSize) {
+ JobAuditStatus jobAuditStatus = new JobAuditStatus();
+ jobAuditStatus.setAdditionalInfo(StringUtils.repeat("a", originalSize));
+ assertThat(jobAuditStatus.getAdditionalInfo().length(), is(finalSize));
+ }
+
+ @Test(dataProvider = "AdditionalInfoSizes")
+ public void testAdditionalInfoMaxLengthInConstructor(int originalSize, int finalSize) {
+ final String additionalInfo = StringUtils.repeat("a", originalSize);
+ JobAuditStatus jobAuditStatus = new JobAuditStatus(UUID.randomUUID(), "myJobStatus", JobAuditStatus.SourceStatus.MSO, UUID.randomUUID(), additionalInfo, new Date());
+ assertThat(jobAuditStatus.getAdditionalInfo().length(), is(finalSize));
+ }
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/RequestReferencesContainerTest.java b/vid-app-common/src/test/java/org/onap/vid/model/RequestReferencesContainerTest.java
index 4587f4e5..38bec90a 100644
--- a/vid-app-common/src/test/java/org/onap/vid/model/RequestReferencesContainerTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/model/RequestReferencesContainerTest.java
@@ -1,9 +1,9 @@
package org.onap.vid.model;
-import java.util.Map;
-
import org.junit.Test;
-import org.onap.vid.domain.mso.RequestReferences;
+import org.onap.vid.mso.model.RequestReferences;
+
+import java.util.Map;
public class RequestReferencesContainerTest {