diff options
2 files changed, 12 insertions, 8 deletions
diff --git a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/zusammen/ItemZusammenDao.java b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/zusammen/ItemZusammenDao.java index b0ca275..d2c755b 100644 --- a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/zusammen/ItemZusammenDao.java +++ b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/zusammen/ItemZusammenDao.java @@ -121,19 +121,19 @@ public class ItemZusammenDao implements ItemDao { info.addProperty(InfoPropertyName.ITEM_TYPE, item.getType()); info.addProperty(InfoPropertyName.ITEM_OWNER, item.getOwner()); if (item.getStatus() != null) { - info.addProperty(InfoPropertyName.ITEM_STATUS, item.getStatus()); + info.addProperty(InfoPropertyName.ITEM_STATUS, item.getStatus().name()); } info.addProperty(InfoPropertyName.ITEM_VERSIONS_STATUSES, item.getVersionStatusCounters()); item.getProperties().forEach(info::addProperty); return info; } - private static final class InfoPropertyName { + static final class InfoPropertyName { - private static final String ITEM_TYPE = "item_type"; - private static final String ITEM_VERSIONS_STATUSES = "item_versions_statuses"; - private static final String ITEM_OWNER = "Owner"; - private static final String ITEM_STATUS = "status"; + static final String ITEM_TYPE = "item_type"; + static final String ITEM_VERSIONS_STATUSES = "item_versions_statuses"; + static final String ITEM_OWNER = "Owner"; + static final String ITEM_STATUS = "status"; private InfoPropertyName() { throw new IllegalStateException("Constants class"); diff --git a/versioning-lib/src/test/java/org/onap/sdc/common/versioning/persistence/zusammen/ItemZusammenDaoTest.java b/versioning-lib/src/test/java/org/onap/sdc/common/versioning/persistence/zusammen/ItemZusammenDaoTest.java index 6c785d3..3b5ab87 100644 --- a/versioning-lib/src/test/java/org/onap/sdc/common/versioning/persistence/zusammen/ItemZusammenDaoTest.java +++ b/versioning-lib/src/test/java/org/onap/sdc/common/versioning/persistence/zusammen/ItemZusammenDaoTest.java @@ -21,6 +21,10 @@ import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.verify; +import static org.onap.sdc.common.versioning.persistence.zusammen.ItemZusammenDao.InfoPropertyName.ITEM_OWNER; +import static org.onap.sdc.common.versioning.persistence.zusammen.ItemZusammenDao.InfoPropertyName.ITEM_STATUS; +import static org.onap.sdc.common.versioning.persistence.zusammen.ItemZusammenDao.InfoPropertyName.ITEM_TYPE; +import static org.onap.sdc.common.versioning.persistence.zusammen.ItemZusammenDao.InfoPropertyName.ITEM_VERSIONS_STATUSES; import com.amdocs.zusammen.datatypes.Id; import com.amdocs.zusammen.datatypes.SessionContext; @@ -52,8 +56,6 @@ import org.onap.sdc.common.zusammen.services.ZusammenAdaptor; @RunWith(MockitoJUnitRunner.class) public class ItemZusammenDaoTest { - private static final String ITEM_TYPE = "item_type"; - private static final String ITEM_VERSIONS_STATUSES = "item_versions_statuses"; private static final String APP_PROP_1 = "app_prop1"; private static final String APP_PROP_2 = "app_prop2"; private static final SessionContext SESSION_CONTEXT = new SessionContext(); @@ -201,6 +203,8 @@ public class ItemZusammenDaoTest { info.setDescription(description); info.addProperty(ITEM_TYPE, type); info.addProperty(ITEM_VERSIONS_STATUSES, versionStatusCounters); + info.addProperty(ITEM_STATUS, ItemStatus.ACTIVE.name()); + info.addProperty(ITEM_OWNER, "ownerUser"); info.addProperty(APP_PROP_1, "app_prop1_value"); info.addProperty(APP_PROP_2, 8); item.setInfo(info); |