@Test
public void getFiles_validDirectoryPath() throws AecuException {

    Resource dirResource = mock(Resource.class);
    when(resolver.getResource(DIR)).thenReturn(dirResource);
    when(dirResource.getName()).thenReturn("dir.author");
    ValueMap dirValues = mock(ValueMap.class);
    when(dirValues.get(JcrConstants.JCR_PRIMARYTYPE, String.class)).thenReturn(JcrResourceConstants.NT_SLING_FOLDER);
    when(dirResource.getValueMap()).thenReturn(dirValues);
    Resource fileResource = mock(Resource.class);
    when(resolver.getResource(DIR + "/" + FILE1)).thenReturn(fileResource);
    when(fileResource.getName()).thenReturn(FILE1);
    ValueMap fileValues = mock(ValueMap.class);
    when(fileValues.get(JcrConstants.JCR_PRIMARYTYPE, String.class)).thenReturn(JcrConstants.NT_FILE);
    when(fileResource.getValueMap()).thenReturn(fileValues);
    when(fileResource.getPath()).thenReturn(DIR + "/" + FILE1);
    when(dirResource.getChildren()).thenReturn(Arrays.asList(fileResource));
    when(dirResource.getChild(FILE1)).thenReturn(fileResource);
    assertEquals(Arrays.asList(DIR + "/" + FILE1), service.getFiles(DIR));
}