blob: 5a98146832715e68df05f795800906e2a1d83b43 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
package org.openecomp.sdc.be.model.cache;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.ImmutableTriple;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.openecomp.sdc.be.config.Configuration;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.cassandra.ComponentCassandraDao;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.resources.data.ComponentCacheData;
import org.slf4j.Logger;
import fj.data.Either;
public class ComponentCacheTest {
ComponentCassandraDao componentCassandraDao = Mockito.mock(ComponentCassandraDao.class);
ToscaOperationFacade toscaOperationFacade = Mockito.mock(ToscaOperationFacade.class);
Configuration configuration = Mockito.mock(Configuration.class);
Logger logger = Mockito.mock(Logger.class);
@InjectMocks
ComponentCache componentCache = new ComponentCache();
private ComponentCache createTestSubject() {
return componentCache;
}
@Before
public void initMocks() {
MockitoAnnotations.initMocks(this);
}
@Test
public void testIsEnabled() throws Exception {
boolean result;
// default test
result = componentCache.isEnabled();
}
@Test
public void testSetEnabled() throws Exception {
boolean enabled = false;
// default test
componentCache.setEnabled(enabled);
}
@Test
public void testGetAllComponentIdTimeAndType() throws Exception {
Either<List<ComponentCacheData>, ActionStatus> result;
// default test
result = componentCache.getAllComponentIdTimeAndType();
}
@Test
public void testDeleteComponentFromCache() throws Exception {
ComponentCache testSubject;
String id = "";
ActionStatus result;
// default test
testSubject = createTestSubject();
result = testSubject.deleteComponentFromCache(id);
}
}
|