diff options
Diffstat (limited to 'ecomp-portal-BE-common-test/src/main/java/com/openecomp')
4 files changed, 167 insertions, 0 deletions
diff --git a/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppCatalogItemTest.java b/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppCatalogItemTest.java new file mode 100644 index 00000000..6fb89146 --- /dev/null +++ b/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppCatalogItemTest.java @@ -0,0 +1,35 @@ +package com.openecomp.portalapp.portal.ecomp.test.model; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem; + +public class AppCatalogItemTest { + + public AppCatalogItem mockAppCatalogItem(){ + AppCatalogItem appCatalogItem = new AppCatalogItem(); + + appCatalogItem.setAlternateUrl("test"); + appCatalogItem.setMlAppName("test"); + + return appCatalogItem; + } + + @Test + public void appCatalogItemTest(){ + AppCatalogItem appCatalogItem = mockAppCatalogItem(); + + AppCatalogItem appCatalogItem1 = new AppCatalogItem(); + appCatalogItem1.setAlternateUrl("test"); + appCatalogItem1.setMlAppName("test"); + + assertEquals(appCatalogItem.getAlternateUrl(), appCatalogItem1.getAlternateUrl()); + assertEquals(appCatalogItem.getMlAppName(), appCatalogItem1.getMlAppName()); + + assertEquals(appCatalogItem.toString(), "AppCatalogItem [id=null, name=null, access=null, select=null, pending=null]"); + assertEquals(appCatalogItem.hashCode(), appCatalogItem1.hashCode()); + assertTrue(appCatalogItem.equals(appCatalogItem1)); + + } +} diff --git a/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppCategoryFunctionsItemTest.java b/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppCategoryFunctionsItemTest.java new file mode 100644 index 00000000..74e74b37 --- /dev/null +++ b/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppCategoryFunctionsItemTest.java @@ -0,0 +1,42 @@ +package com.openecomp.portalapp.portal.ecomp.test.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem; + +public class AppCategoryFunctionsItemTest { + + public AppCategoryFunctionsItem mockAppCategoryFunctionsItem(){ + AppCategoryFunctionsItem appCategoryFunctionsItem = new AppCategoryFunctionsItem(); + + appCategoryFunctionsItem.setRowId("test"); + appCategoryFunctionsItem.setAppId("test"); + appCategoryFunctionsItem.setApplication("test"); + appCategoryFunctionsItem.setFunctions("test"); + + return appCategoryFunctionsItem; + } + + @Test + public void appCategoryFunctionsItemTest(){ + AppCategoryFunctionsItem appCategoryFunctionsItem = mockAppCategoryFunctionsItem(); + + AppCategoryFunctionsItem appCategoryFunctionsItem1 = new AppCategoryFunctionsItem(); + + appCategoryFunctionsItem1.setRowId("test"); + appCategoryFunctionsItem1.setAppId("test"); + appCategoryFunctionsItem1.setApplication("test"); + appCategoryFunctionsItem1.setFunctions("test"); + + assertEquals(appCategoryFunctionsItem.getRowId(), appCategoryFunctionsItem1.getRowId()); + assertEquals(appCategoryFunctionsItem.getAppId(), appCategoryFunctionsItem1.getAppId()); + assertEquals(appCategoryFunctionsItem.getApplication(), appCategoryFunctionsItem1.getApplication()); + assertEquals(appCategoryFunctionsItem.getFunctions(), appCategoryFunctionsItem1.getFunctions()); + assertEquals(appCategoryFunctionsItem.toString(), "AppCategoryFunctionsItem [rowId=test, appId=test, application=test, category=null, functions=test]"); + assertEquals(appCategoryFunctionsItem.hashCode(), appCategoryFunctionsItem1.hashCode()); + assertTrue(appCategoryFunctionsItem.equals(appCategoryFunctionsItem1)); + + } +} diff --git a/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppContactUsItemTest.java b/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppContactUsItemTest.java new file mode 100644 index 00000000..41539282 --- /dev/null +++ b/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/AppContactUsItemTest.java @@ -0,0 +1,49 @@ +package com.openecomp.portalapp.portal.ecomp.test.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem; + +public class AppContactUsItemTest { + + public AppContactUsItem mockAppContactUsItem(){ + AppContactUsItem appContactUsItem = new AppContactUsItem(); + + appContactUsItem.setAppId((long)1); + appContactUsItem.setAppName("test"); + appContactUsItem.setDescription("test"); + appContactUsItem.setContactName("test"); + appContactUsItem.setContactEmail("test"); + appContactUsItem.setUrl("test"); + appContactUsItem.setActiveYN("test"); + + return appContactUsItem; + } + + @Test + public void appContactUsItemTest(){ + AppContactUsItem appContactUsItem = mockAppContactUsItem(); + + AppContactUsItem appContactUsItem1 = new AppContactUsItem(); + appContactUsItem1.setAppId((long)1); + appContactUsItem1.setAppName("test"); + appContactUsItem1.setDescription("test"); + appContactUsItem1.setContactName("test"); + appContactUsItem1.setContactEmail("test"); + appContactUsItem1.setUrl("test"); + appContactUsItem1.setActiveYN("test"); + + assertEquals(appContactUsItem.getAppId(), appContactUsItem1.getAppId()); + assertEquals(appContactUsItem.getAppName(), appContactUsItem1.getAppName()); + assertEquals(appContactUsItem.getDescription(), appContactUsItem1.getDescription()); + assertEquals(appContactUsItem.getContactName(), appContactUsItem1.getContactName()); + assertEquals(appContactUsItem.getContactEmail(), appContactUsItem1.getContactEmail()); + assertEquals(appContactUsItem.getUrl(), appContactUsItem1.getUrl()); + assertEquals(appContactUsItem.getActiveYN(), appContactUsItem1.getActiveYN()); + assertEquals(appContactUsItem.toString(), "AppContactUsItem [appId=1, appName=test, description=test, contactName=test, contactEmail=test, url=test, activeYN=test]"); + assertEquals(appContactUsItem.hashCode(), appContactUsItem1.hashCode()); + assertTrue(appContactUsItem.equals(appContactUsItem1)); + } +} diff --git a/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/SearchResultItemTest.java b/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/SearchResultItemTest.java new file mode 100644 index 00000000..97e3be6c --- /dev/null +++ b/ecomp-portal-BE-common-test/src/main/java/com/openecomp/portalapp/portal/ecomp/test/model/SearchResultItemTest.java @@ -0,0 +1,41 @@ +package com.openecomp.portalapp.portal.ecomp.test.model; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem; + +public class SearchResultItemTest { + + public SearchResultItem mockSearchResultItem(){ + SearchResultItem searchResultItem = new SearchResultItem(); + + searchResultItem.setRowId("test"); + searchResultItem.setCategory("test"); + searchResultItem.setName("test"); + searchResultItem.setTarget("test"); + searchResultItem.setUuid("test"); + + return searchResultItem; + } + + @Test + public void searchResultItemTest(){ + SearchResultItem searchResultItem = mockSearchResultItem(); + + SearchResultItem searchResultItem1 = new SearchResultItem(); + searchResultItem1.setRowId("test"); + searchResultItem1.setCategory("test"); + searchResultItem1.setName("test"); + searchResultItem1.setTarget("test"); + searchResultItem1.setUuid("test"); + + assertEquals(searchResultItem.getRowId(), searchResultItem.getRowId()); + assertEquals(searchResultItem.getCategory(), searchResultItem.getCategory()); + assertEquals(searchResultItem.getName(), searchResultItem.getName()); + assertEquals(searchResultItem.getTarget(), searchResultItem.getTarget()); + assertEquals(searchResultItem.getUuid(), searchResultItem.getUuid()); + assertEquals(searchResultItem.toString(), searchResultItem.toString()); + + } +} |