public class SourceService implements ServerComponent {
+ private static final int THREE_THOUSAND_LINES_SIZE = 3000 * 20;
+
private final DbClient dbClient;
private final SnapshotSourceDao snapshotSourceDao;
private final HtmlSourceDecorator sourceDecorator;
}
private static boolean sizeBiggerThan3000Lines (String source){
- return source.length() > 120000;
+ return source.length() > THREE_THOUSAND_LINES_SIZE;
}
private static List<String> getLinesAsTxt(@Nullable String source) {
public void return_txt_when_source_is_too_big() throws Exception {
MockUserSession.set().addComponentPermission(UserRole.CODEVIEWER, PROJECT_KEY, COMPONENT_KEY);
- when(snapshotSourceDao.selectSnapshotSourceByComponentKey(COMPONENT_KEY, session)).thenReturn(Strings.repeat("a\n", 130000));
+ when(snapshotSourceDao.selectSnapshotSourceByComponentKey(COMPONENT_KEY, session)).thenReturn(Strings.repeat("a\n", 70000));
List<String> lines = service.getLinesAsHtml(COMPONENT_KEY);
assertThat(lines).isNotEmpty();