diff options
author | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-01-15 06:47:58 +0000 |
---|---|---|
committer | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-01-15 06:55:52 +0000 |
commit | b9e7b1ad0cdb380600b8278b33682d8fb47a9f1b (patch) | |
tree | 02e202ac2b1c2c084d44f63e8954a127b5fb40af /mso-catalog-db/src/test/java | |
parent | a7e7bb435f0bdb851dadcd8cdeacdf7b20d02147 (diff) |
Add test case for getHeatTemplate
Add test case for getHeatTemplage body.
Change-Id: Iabcefa9d27b6b146921b50c99413e56273a21b3b
Issue-ID: SO-360
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'mso-catalog-db/src/test/java')
-rw-r--r-- | mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java index 5e6ccc4a86..e19c67f7d0 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java @@ -282,9 +282,27 @@ public class CatalogDatabaseTest { assertEquals(null, ht); } - @Test(expected = Exception.class) + @Test public void getHeatTemplateByArtifactUuidException(){ + + MockUp<Session> mockedSession = new MockUp<Session>() { + @Mock + public Object get(Class cls, Serializable id) { + HeatTemplate heatTemplate = new HeatTemplate(); + heatTemplate.setAsdcUuid("123-uuid"); + return heatTemplate; + } + }; + + new MockUp<CatalogDatabase>() { + @Mock + private Session getSession() { + return mockedSession.getMockInstance(); + } + }; + HeatTemplate ht = cd.getHeatTemplateByArtifactUuid("123"); + assertEquals("123-uuid", ht.getAsdcUuid()); } @Test(expected = Exception.class) |