summaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authorEran (ev672n), Vosk <ev672n@att.com>2018-10-28 14:50:57 +0200
committerEran (ev672n), Vosk <ev672n@att.com>2018-10-28 14:50:57 +0200
commitf226cd89b2da5046eff1361bcc39eeeccceb75ab (patch)
tree53f110eb5d449ef0c7d0b4594c397227f13eb2c7 /src/test/java/org
parent6c927ced25738eec636a4a0ce075285887767358 (diff)
Adding more UTs
Raising the code coverage in the project Change-Id: I3540af36efc938ab06ec3361e709edf482744b1a Issue-ID: SDC-1872 Signed-off-by: Eran (ev672n), Vosk <ev672n@att.com>
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/onap/sdc/dcae/composition/restmodels/DcaeMinimizedServiceTest.java56
-rw-r--r--src/test/java/org/onap/sdc/dcae/composition/restmodels/canvas/SubCategoryFolderTest.java12
-rw-r--r--src/test/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/MappingRulesTest.java37
3 files changed, 105 insertions, 0 deletions
diff --git a/src/test/java/org/onap/sdc/dcae/composition/restmodels/DcaeMinimizedServiceTest.java b/src/test/java/org/onap/sdc/dcae/composition/restmodels/DcaeMinimizedServiceTest.java
new file mode 100644
index 0000000..acaaa07
--- /dev/null
+++ b/src/test/java/org/onap/sdc/dcae/composition/restmodels/DcaeMinimizedServiceTest.java
@@ -0,0 +1,56 @@
+package org.onap.sdc.dcae.composition.restmodels;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+public class DcaeMinimizedServiceTest {
+
+ private static final String UUID = "uuid";
+ private static final String NAME = "name";
+ private static final String LAST_UPDATER_USER_ID = "lastUpdaterUserId";
+ private static final String LIFE_CYCLE_STATE = "lifeCycleState";
+ private static final String VERSION = "1.1";
+ private static final String INVARIANT_UUID = "invariantUUID";
+ private DcaeMinimizedService classUnderTest;
+
+ @Before
+ public void setup() {
+ classUnderTest = new DcaeMinimizedService(UUID, NAME,
+ LAST_UPDATER_USER_ID, LIFE_CYCLE_STATE,
+ VERSION, INVARIANT_UUID);
+ }
+
+ @Test
+ public void shouldHaveValidGetters() {
+ assertEquals(UUID, classUnderTest.getUuid());
+ assertEquals(NAME, classUnderTest.getName());
+ assertEquals(LAST_UPDATER_USER_ID, classUnderTest.getLastUpdaterUserId());
+ assertEquals(LIFE_CYCLE_STATE, classUnderTest.getLifeCycleState());
+ assertEquals(VERSION, classUnderTest.getVersion());
+ assertEquals(INVARIANT_UUID, classUnderTest.getInvariantUUID());
+
+ }
+
+ @Test
+ public void shouldHaveValidGettersAndSetters() {
+
+ classUnderTest.setUuid(UUID + "1");
+ classUnderTest.setName(NAME + "1");
+ classUnderTest.setLastUpdaterUserId(LAST_UPDATER_USER_ID + "1");
+ classUnderTest.setLifeCycleState(LIFE_CYCLE_STATE + "1");
+ classUnderTest.setVersion(VERSION + "1");
+ classUnderTest.setInvariantUUID(INVARIANT_UUID + "1");
+
+ assertEquals(UUID + "1", classUnderTest.getUuid());
+ assertEquals(NAME + "1", classUnderTest.getName());
+ assertEquals(LAST_UPDATER_USER_ID + "1", classUnderTest.getLastUpdaterUserId());
+ assertEquals(LIFE_CYCLE_STATE + "1", classUnderTest.getLifeCycleState());
+ assertEquals(VERSION + "1", classUnderTest.getVersion());
+ assertEquals(INVARIANT_UUID + "1", classUnderTest.getInvariantUUID());
+ }
+
+
+}
diff --git a/src/test/java/org/onap/sdc/dcae/composition/restmodels/canvas/SubCategoryFolderTest.java b/src/test/java/org/onap/sdc/dcae/composition/restmodels/canvas/SubCategoryFolderTest.java
new file mode 100644
index 0000000..bc2c2d5
--- /dev/null
+++ b/src/test/java/org/onap/sdc/dcae/composition/restmodels/canvas/SubCategoryFolderTest.java
@@ -0,0 +1,12 @@
+package org.onap.sdc.dcae.composition.restmodels.canvas;
+
+import org.junit.Test;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
+import static org.junit.Assert.assertThat;
+
+public class SubCategoryFolderTest {
+ @Test
+ public void shouldHaveValidGettersAndSetters() {
+ assertThat(DcaeComponentCatalog.SubCategoryFolder.class, hasValidGettersAndSetters()); }
+}
diff --git a/src/test/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/MappingRulesTest.java b/src/test/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/MappingRulesTest.java
new file mode 100644
index 0000000..a8a15d3
--- /dev/null
+++ b/src/test/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/MappingRulesTest.java
@@ -0,0 +1,37 @@
+package org.onap.sdc.dcae.composition.restmodels.ruleeditor;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.sdc.dcae.composition.restmodels.DcaeMinimizedService;
+
+import static org.junit.Assert.assertEquals;
+
+public class MappingRulesTest {
+
+ public static final String ENTRY_PHASE = "entryPhase";
+ public static final String PUBLISH_PHASE = "publishPhase";
+ public static final String VERSION = "1.1";
+ public static final String EVENT_TYPE = "eventType";
+ public static final String NOTIFY_ID = "notifyId";
+ private MappingRules classUnderTest;
+
+ @Before
+ public void setup() {
+ classUnderTest = new MappingRules();
+ }
+
+ @Test
+ public void shouldHaveValidGettersAndSetters() {
+ classUnderTest.setEntryPhase(ENTRY_PHASE);
+ classUnderTest.setPublishPhase(PUBLISH_PHASE);
+ classUnderTest.setVersion(VERSION);
+ classUnderTest.setEventType(EVENT_TYPE);
+ classUnderTest.setNotifyId(NOTIFY_ID);
+
+ assertEquals(ENTRY_PHASE, classUnderTest.getEntryPhase());
+ assertEquals(PUBLISH_PHASE, classUnderTest.getPublishPhase());
+ assertEquals(VERSION, classUnderTest.getVersion());
+ assertEquals(EVENT_TYPE, classUnderTest.getEventType());
+ assertEquals(NOTIFY_ID, classUnderTest.getNotifyId());
+ }
+}