aboutsummaryrefslogtreecommitdiffstats
path: root/appc-core
diff options
context:
space:
mode:
authorZihmin Hoover <zh4590@att.com>2019-02-07 16:05:51 -0500
committerTakamune Cho <takamune.cho@att.com>2019-02-08 23:18:16 +0000
commit28c931d73c4ff56a6c14025b88c5b8e9b677fee9 (patch)
tree4fea121acb0ffb16dad0f440aab9163c62eeb064 /appc-core
parent74cf8508ab0a778aec0a38e3786b1f17f1596385 (diff)
Add junit coverage to MetadataCacheFactory class
Add more test runs to MetadataCacheFactoryTest class Change-Id: I52871dfb876be91bd4600390af3bfee9d356e121 Issue-ID: APPC-1047 Signed-off-by: Zihmin Hoover <zh4590@att.com>
Diffstat (limited to 'appc-core')
-rw-r--r--appc-core/appc-common-bundle/src/test/java/org/onap/appc/cache/impl/MetadataCacheFactoryTest.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/appc-core/appc-common-bundle/src/test/java/org/onap/appc/cache/impl/MetadataCacheFactoryTest.java b/appc-core/appc-common-bundle/src/test/java/org/onap/appc/cache/impl/MetadataCacheFactoryTest.java
index 26a5b3596..3d2db38c6 100644
--- a/appc-core/appc-common-bundle/src/test/java/org/onap/appc/cache/impl/MetadataCacheFactoryTest.java
+++ b/appc-core/appc-common-bundle/src/test/java/org/onap/appc/cache/impl/MetadataCacheFactoryTest.java
@@ -27,14 +27,11 @@ package org.onap.appc.cache.impl;
import org.junit.Assert;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
+import org.onap.appc.cache.CacheStrategies;
import org.powermock.reflect.Whitebox;
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(MetadataCacheImpl.class)
public class MetadataCacheFactoryTest {
+
@Test
public void testConstructor() throws Exception {
Whitebox.invokeConstructor(MetadataCacheFactory.class);
@@ -46,4 +43,15 @@ public class MetadataCacheFactoryTest {
Assert.assertEquals("Should always return the same object",
MetadataCacheFactory.getInstance(), MetadataCacheFactory.getInstance());
}
-}
+
+ @Test
+ public void testGetMetadataCacheWithNoArgument() throws Exception {
+ Assert.assertNotNull(MetadataCacheFactory.getInstance().getMetadataCache());
+ }
+
+ @Test
+ public void testGetMetadataCacheWithArgument() throws Exception {
+ CacheStrategies cacheStrategies = CacheStrategies.LRU;
+ Assert.assertNotNull(MetadataCacheFactory.getInstance().getMetadataCache(cacheStrategies));
+ }
+} \ No newline at end of file