use of org.wso2.carbon.registry.indexing.IndexingManager in project carbon-apimgt by wso2.
the class CustomAPIIndexerTest method init.
@Before
public void init() throws RegistryException {
PowerMockito.mockStatic(GovernanceUtils.class);
PowerMockito.mockStatic(IndexingManager.class);
IndexingManager indexingManager = Mockito.mock(IndexingManager.class);
PowerMockito.when(IndexingManager.getInstance()).thenReturn(indexingManager);
userRegistry = Mockito.mock(UserRegistry.class);
Mockito.doReturn(userRegistry).when(indexingManager).getRegistry(Mockito.anyInt());
Mockito.doReturn(true).when(userRegistry).resourceExists(Mockito.anyString());
PowerMockito.when(GovernanceUtils.getGovernanceSystemRegistry(userRegistry)).thenReturn(userRegistry);
String path = RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + "/api";
file2Index = new AsyncIndexer.File2Index("".getBytes(), null, path, -1234, "");
indexer = new CustomAPIIndexer();
}
Aggregations