Implement option to load rest of files completely

This commit is contained in:
René Pfeuffer
2020-05-30 18:12:03 +02:00
parent b86c025b37
commit 751a2bfa9b
5 changed files with 38 additions and 7 deletions

View File

@@ -109,6 +109,18 @@ public class ContentResourceTest {
assertEquals("line 2\nline 3\n", baos.toString());
}
@Test
public void shouldNotLimitOutputWhenEndLessThanZero() throws Exception {
mockContent("file", "line 1\nline 2\nline 3\nline 4".getBytes());
Response response = contentResource.get(NAMESPACE, REPO_NAME, REV, "file", 1, -1);
assertEquals(200, response.getStatus());
ByteArrayOutputStream baos = readOutputStream(response);
assertEquals("line 2\nline 3\nline 4", baos.toString());
}
@Test
public void shouldHandleMissingFile() {
Response response = contentResource.get(NAMESPACE, REPO_NAME, REV, "doesNotExist", null, null);