use of org.pentaho.platform.plugin.services.metadata.PentahoMetadataDomainRepository in project data-access by pentaho.
the class MetadataServiceTest method testGetMetadataDatasourceAclNoAcl.
@Test
public void testGetMetadataDatasourceAclNoAcl() throws Exception {
String domainId = DOMAIN_ID;
doReturn(true).when(metadataService).canManageACL();
when(metadataService.aclAwarePentahoMetadataDomainRepositoryImporter.getAclFor(domainId)).thenReturn(null);
final Map<String, InputStream> domainFilesData = mock(Map.class);
when(domainFilesData.isEmpty()).thenReturn(false);
when(((PentahoMetadataDomainRepository) metadataService.metadataDomainRepository).getDomainFilesData(domainId)).thenReturn(domainFilesData);
final RepositoryFileAclDto aclDto = metadataService.getMetadataAcl(domainId);
verify(metadataService.aclAwarePentahoMetadataDomainRepositoryImporter).getAclFor(eq(domainId));
assertNull(aclDto);
}
Aggregations