blob: 04379e5dc60d5adabe43a5cd9c464d4027afe355 (
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
|
package org.onap.appc.data.services.node;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import org.onap.appc.data.services.db.DGGeneralDBService;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
class MockDbServiceBuilder {
private final DGGeneralDBService dbServiceMock;
MockDbServiceBuilder() throws SvcLogicException {
dbServiceMock = mock(DGGeneralDBService.class);
doReturn(SvcLogicResource.QueryStatus.SUCCESS)
.when(dbServiceMock)
.getConfigFileReferenceByFileTypeNVnfType(any(SvcLogicContext.class), anyString(), anyString());
}
MockDbServiceBuilder configFileReference(String prefix, String fileType, SvcLogicResource.QueryStatus status) throws SvcLogicException {
doReturn(status)
.when(dbServiceMock)
.getConfigFileReferenceByFileTypeNVnfType(any(SvcLogicContext.class), eq(prefix), eq(fileType));
return this;
}
DGGeneralDBService build() {
return dbServiceMock;
}
}
|