mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
Add limit parameter
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user