blob: 2beb36b4b1c82e314bd469b0c2b67a184a400901 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package org.onap.aai.sparky.dal.cache;
import org.junit.Assert;
import org.junit.Test;
import org.onap.aai.sparky.dal.rest.OperationResult;
public class InMemoryEntityCacheTest {
@Test
public void testInMemoryEntityCache_AllMethods() {
InMemoryEntityCache imec = new InMemoryEntityCache();
imec.put("key-1", null);
Assert.assertNull(imec.get("entity-1", "key-1"));
Assert.assertNull(imec.get("entity-1", null));
OperationResult result = new OperationResult();
result.setResultCode(200);
result.setResult("result-1");
result.setNumRequestRetries(1);
imec.put("key-1", result);
Assert.assertNotNull(imec.get("entity-1", "key-1"));
}
}
|