Search in sources :

Example 1 with StringListWrapper

use of org.pentaho.platform.web.http.api.resources.StringListWrapper in project pentaho-platform by pentaho.

the class FileServiceTest method testDoGetPathsAccessList.

@Test
public void testDoGetPathsAccessList() {
    List<String> paths = new ArrayList<String>();
    paths.add("path1");
    paths.add("path2");
    paths.add("path3");
    doReturn(true).when(fileService.repository).hasAccess(anyString(), any(EnumSet.class));
    List<Setting> settings = fileService.doGetPathsAccessList(new StringListWrapper(paths));
    assertTrue(settings.size() > 0);
    doReturn(false).when(fileService.repository).hasAccess(anyString(), any(EnumSet.class));
    settings = fileService.doGetPathsAccessList(new StringListWrapper(paths));
    assertEquals(0, settings.size());
}
Also used : EnumSet(java.util.EnumSet) Setting(org.pentaho.platform.web.http.api.resources.Setting) ArrayList(java.util.ArrayList) Matchers.anyString(org.mockito.Matchers.anyString) StringListWrapper(org.pentaho.platform.web.http.api.resources.StringListWrapper) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 EnumSet (java.util.EnumSet)1 Test (org.junit.Test)1 Matchers.anyString (org.mockito.Matchers.anyString)1 Setting (org.pentaho.platform.web.http.api.resources.Setting)1 StringListWrapper (org.pentaho.platform.web.http.api.resources.StringListWrapper)1