Skip to content

Commit

Permalink
code climate issues
Browse files Browse the repository at this point in the history
  • Loading branch information
YegorKozlov committed Jan 3, 2025
1 parent eaf230c commit d051472
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ void update(Resource root, Collection<Map<String, Object>> xlsRedirects, Map<Str
}
Resource redirect = getOrCreateRedirect(shard, sourcePath, props, jcrRedirects);
log.trace("rule[{}]: {}", count, redirect.getPath());
if(count % SHARD_SIZE == 0) resolver.commit();
if(count % SHARD_SIZE == 0) {
resolver.commit();
}
}
} else {
for (Map<String, Object> props : xlsRedirects) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,16 +482,14 @@ private void setupFileUpload(byte[] content, String contentType) throws IOExcept
}

private byte[] createMockExcelFile() throws IOException {
List<RedirectRule> rules = new ArrayList<>();
RedirectRule rule = spy(new RedirectRule());
doReturn("/old").when(rule).getSource();
doReturn("/new").when(rule).getTarget();
doReturn(301).when(rule).getStatusCode();
doReturn(null).when(rule).getCreatedBy();
doReturn(null).when(rule).getModifiedBy();
rules.add(rule);

Workbook wb = export(rules);
Workbook wb = export(Collections.singletonList(rule));

ByteArrayOutputStream out = new ByteArrayOutputStream();
wb.write(out);
Expand Down

0 comments on commit d051472

Please sign in to comment.