and removed unused imports
Issue-ID: APPC-1086
Change-Id: I18009404898a938ec23be77bfcf94084f4e9badd
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
package org.onap.appc.cache.impl;
package org.onap.appc.cache.impl;
+import org.junit.Before;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
public class LRUCacheTest {
public class LRUCacheTest {
+ private LRUCache cache;
+
+ @Before
+ public void setUp() {
+ cache = new LRUCache(20);
+ }
+
@Test
public void testConstructor() throws Exception {
@Test
public void testConstructor() throws Exception {
- LRUCache cache = new LRUCache(20);
Map internalMap = Whitebox.getInternalState(cache, "map");
Assert.assertTrue(internalMap != null);
Assert.assertTrue(internalMap.size() == 0);
Map internalMap = Whitebox.getInternalState(cache, "map");
Assert.assertTrue(internalMap != null);
Assert.assertTrue(internalMap.size() == 0);
@Test
public void testGetAndPutObject() throws Exception {
@Test
public void testGetAndPutObject() throws Exception {
- LRUCache cache = new LRUCache(20);
-
String key = "testing key";
Assert.assertTrue(cache.getObject(key) == null);
String key = "testing key";
Assert.assertTrue(cache.getObject(key) == null);