Add limit parameter

This commit is contained in:
René Pfeuffer
2020-02-17 16:48:14 +01:00
parent d6fe305438
commit db540f5f02
4 changed files with 59 additions and 0 deletions

View File

@@ -236,6 +236,19 @@ public class GitBrowseCommandTest extends AbstractGitCommandTestBase {
.containsExactly(of(42L));
}
@Test
public void testBrowseLimit() throws IOException {
BrowseCommandRequest request = new BrowseCommandRequest();
request.setLimit(2);
FileObject root = createCommand()
.getBrowserResult(request).getFile();
assertNotNull(root);
Collection<FileObject> foList = root.getChildren();
assertThat(foList).hasSize(2);
}
private FileObject findFile(Collection<FileObject> foList, String name) {
return foList.stream()
.filter(f -> name.equals(f.getName()))