Add tests for the review fixes and make the context test runnable

- ReFoundApplicationTests runs on PostgreSQL via Testcontainers with a test
  profile holding test-only JWT/Redis/MinIO values; it previously failed
  without JWT_SECRET. The test also checks Liquibase + ddl validate.
- Unit tests: JWT access/refresh separation, refresh rotation, admin
  authority, exception mapping, image signature checks, ad media Range
  responses, post deletion after commit, moderation races, campaign status,
  ad selection without HttpSession and with Redis down, target URL rules.
- resolveRange rejects ranges that start past the end of the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SlimusMinus
2026-10-20 01:08:29 +03:00
parent 3fd045131c
commit 6b647e0bbf
12 changed files with 971 additions and 1 deletions

View File

@@ -188,7 +188,10 @@ public class AdvertisingMediaService {
return null;
}
HttpRange range = ranges.get(0);
return new long[] {range.getRangeStart(length), range.getRangeEnd(length)};
long start = range.getRangeStart(length);
long end = range.getRangeEnd(length);
// HttpRange не проверяет, что начало диапазона внутри файла
return start < length && start <= end ? new long[] {start, end} : null;
} catch (IllegalArgumentException e) {
return null;
}