diff options
author | 2018-02-20 12:00:10 -0500 | |
---|---|---|
committer | 2018-02-20 12:00:10 -0500 | |
commit | 724ff8f8b22d6503ce5070ebc13f6f5fbc48c8cf (patch) | |
tree | 063414ae8d035fe9957cba3833661a915c1f8eff /ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/command/PostSearchBeanTest.java | |
parent | 20602aa99841048e65a36dc26d8bfc4d6a11fcc9 (diff) |
Increase JUNIT Coverage
Issue-ID: PORTAL-136
Change-Id: I2223003924f36043753bef401ed1d8ee87f4a65e
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/command/PostSearchBeanTest.java')
-rw-r--r-- | ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/command/PostSearchBeanTest.java | 97 |
1 files changed, 96 insertions, 1 deletions
diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/command/PostSearchBeanTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/command/PostSearchBeanTest.java index b5bc3477..905f1b93 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/command/PostSearchBeanTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/command/PostSearchBeanTest.java @@ -37,12 +37,16 @@ */ package org.onap.portalsdk.core.command; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import org.junit.Test; +import junit.framework.Assert; + public class PostSearchBeanTest { + PostSearchBean postSearchBean= new PostSearchBean(); public PostSearchBean mockPostSearchBean() { @@ -92,6 +96,24 @@ public class PostSearchBeanTest { postSearchBean.setEmailOrig("testEmailOrig"); postSearchBean.setOrgManagerUserIdOrig("testOrgManagerUserIdOrig"); + postSearchBean.setSortBy1(null); + postSearchBean.setSortBy2(null); + postSearchBean.setSortBy3(null); + postSearchBean.setSortBy1Orig(null); + postSearchBean.setSortBy2Orig(null); + postSearchBean.setSortBy3Orig(null); + postSearchBean.setAccessType(null); + postSearchBean.setSubmitAction(null); + postSearchBean.setMasterId(null); + postSearchBean.setDetailId(null); + postSearchBean.setShowResult(null); + postSearchBean.setSearchResult(null); + postSearchBean.setSortByModifier1(null); + postSearchBean.setSortByModifier1Orig(null); + postSearchBean.setSortByModifier2(null); + postSearchBean.setSortByModifier2Orig(null); + postSearchBean.setSortByModifier3(null); + postSearchBean.setSortByModifier3Orig(null); return postSearchBean; } @@ -145,6 +167,26 @@ public class PostSearchBeanTest { postSearchBean.setOrgCodeOrig("testOrgCodeOrig"); postSearchBean.setEmailOrig("testEmailOrig"); postSearchBean.setOrgManagerUserIdOrig("testOrgManagerUserIdOrig"); + + postSearchBean.setSortBy1(null); + postSearchBean.setSortBy2(null); + postSearchBean.setSortBy3(null); + postSearchBean.setSortBy1Orig(null); + postSearchBean.setSortBy2Orig(null); + postSearchBean.setSortBy3Orig(null); + postSearchBean.setAccessType(null); + postSearchBean.setSubmitAction(null); + postSearchBean.setMasterId(null); + postSearchBean.setDetailId(null); + postSearchBean.setShowResult(null); + postSearchBean.setSearchResult(null); + postSearchBean.setSortByModifier1(null); + postSearchBean.setSortByModifier1Orig(null); + postSearchBean.setSortByModifier2(null); + postSearchBean.setSortByModifier2Orig(null); + postSearchBean.setSortByModifier3(null); + postSearchBean.setSortByModifier3Orig(null); + assertNull(postSearchBean.getUser().getCity()); assertNull(postSearchBean.getUserOrig().getCity()); assertEquals(postSearchBean.getSelected().length, mockPostSearchBean.getSelected().length); @@ -189,5 +231,58 @@ public class PostSearchBeanTest { assertEquals(postSearchBean.getEmailOrig(),mockPostSearchBean.getEmailOrig()); assertEquals(postSearchBean.getOrgManagerUserIdOrig(),mockPostSearchBean.getOrgManagerUserIdOrig()); + assertEquals(postSearchBean.getSortBy1(),mockPostSearchBean.getSortBy1()); + assertEquals(postSearchBean.getSortBy2(),mockPostSearchBean.getSortBy2()); + assertEquals(postSearchBean.getSortBy3(),mockPostSearchBean.getSortBy3()); + assertEquals(postSearchBean.getSortBy1Orig(),mockPostSearchBean.getSortBy1Orig()); + assertEquals(postSearchBean.getSortBy2Orig(),mockPostSearchBean.getSortBy2Orig()); + assertEquals(postSearchBean.getSortBy3Orig(),mockPostSearchBean.getSortBy3Orig()); + assertEquals(postSearchBean.getAccessType(),mockPostSearchBean.getAccessType()); + assertEquals(postSearchBean.getSubmitAction(),mockPostSearchBean.getSubmitAction()); + assertEquals(postSearchBean.getMasterId(),mockPostSearchBean.getMasterId()); + assertEquals(postSearchBean.getDetailId(),mockPostSearchBean.getDetailId()); + assertEquals(postSearchBean.getShowResult(),mockPostSearchBean.getShowResult()); + assertEquals(postSearchBean.getSearchResult(),mockPostSearchBean.getSearchResult()); + assertEquals(postSearchBean.getSortByModifier1(),mockPostSearchBean.getSortByModifier1()); + assertEquals(postSearchBean.getSortByModifier1Orig(),mockPostSearchBean.getSortByModifier1Orig()); + assertEquals(postSearchBean.getSortByModifier2(),mockPostSearchBean.getSortByModifier2()); + assertEquals(postSearchBean.getSortByModifier2Orig(),mockPostSearchBean.getSortByModifier2Orig()); + assertEquals(postSearchBean.getSortByModifier3(),mockPostSearchBean.getSortByModifier3()); + assertEquals(postSearchBean.getSortByModifier3Orig(),mockPostSearchBean.getSortByModifier3Orig()); + } + + @Test + public void getPageNoTest(){ + postSearchBean.setPageNo(1); + postSearchBean.getPageNo(); + } + + @Test + public void getPageSizeTest(){ + postSearchBean.setPageSize(1); + postSearchBean.getPageSize(); + } + + @Test + public void getDataSizeTest(){ + postSearchBean.setDataSize(1); + postSearchBean.getDataSize(); + } + + @Test + public void getNewDataSizeTest(){ + postSearchBean.getNewDataSize(); } + + @SuppressWarnings("deprecation") + @Test + public void isSortingUpdatedTest(){ + Assert.assertEquals(false, postSearchBean.isSortingUpdated()); + } + + @Test + public void resetSearchTest(){ + postSearchBean.resetSearch(); + } + } |