summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
74cf850)
Add more test runs to MetadataCacheFactoryTest class
Change-Id: I52871dfb876be91bd4600390af3bfee9d356e121
Issue-ID: APPC-1047
Signed-off-by: Zihmin Hoover <zh4590@att.com>
import org.junit.Assert;
import org.junit.Test;
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;
import org.powermock.reflect.Whitebox;
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(MetadataCacheImpl.class)
public class MetadataCacheFactoryTest {
public class MetadataCacheFactoryTest {
@Test
public void testConstructor() throws Exception {
Whitebox.invokeConstructor(MetadataCacheFactory.class);
@Test
public void testConstructor() throws Exception {
Whitebox.invokeConstructor(MetadataCacheFactory.class);
Assert.assertEquals("Should always return the same object",
MetadataCacheFactory.getInstance(), MetadataCacheFactory.getInstance());
}
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