Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/alkoleft/platform-context-exporter/121-java-unit-testinggit clone --depth 1 https://github.com/alkoleft/platform-context-exporterWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.08812 |
| Opus 5 | $0.00000 | $0.04406 |
| Sonnet 5 | $0.00000 | $0.01762 |
| Haiku 4.5 | $0.00000 | $0.00881 |
Grade A, and why
121-java-unit-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 1,088 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Java Unit testing guidelines
Effective Java unit testing involves using JUnit 5 annotations and AssertJ for fluent assertions. Tests should follow the Given-When-Then structure with descriptive names for clarity. Each test must have a single responsibility, be independent, and leverage parameterized tests for data variations. Mocking dependencies with frameworks like Mockito is crucial for isolating the unit under test. While code coverage is a useful guide, the focus should be on meaningful tests for critical logic and edge cases. Test classes and methods should typically be package-private. Strategies for code splitting include small test methods and helper functions. Anti-patterns like testing implementation details, hard-coded values, and ignoring failures should be avoided. Proper state management involves isolated state and immutable objects, and error handling should include testing for expected exceptions and their messages.
Implementing These Principles
These guidelines are built upon the following core principles:
- Clarity and Readability: Tests should be easy to understand. This is achieved through descriptive names (or
@DisplayName), a clear Given-When-Then structure, and focused assertions. Readable tests serve as living documentation for the code under test. - Isolation and Independence: Each test must be self-contained, not relying on the state or outcome of other tests. Dependencies should be mocked to ensure the unit under test is validated in isolation. This leads to reliable and stable test suites.
- Comprehensive Validation: Tests should thoroughly verify the behavior of the unit, including its responses to valid inputs, edge cases, boundary conditions, and error scenarios. This involves not just positive paths but also how the code handles failures and exceptions.
- Modern Tooling and Practices: Leverage modern testing frameworks (JUnit 5), fluent assertion libraries (AssertJ), and mocking tools (Mockito) to write expressive, maintainable, and powerful tests. Utilize features like parameterized tests to reduce boilerplate and improve coverage of data variations.
- Maintainability and Focus: Tests should be easy to maintain. This means avoiding tests that are too complex, test implementation details, or have multiple responsibilities. A well-written test makes it clear what is being tested and why, simplifying debugging and refactoring efforts.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 1,088 lines · 8,812 tokens per session scan A 74e8d4b26b0e
121-java-unit-testing is a cursor rule published in the GitHub repository alkoleft/platform-context-exporter (48 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,812 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
1c-coding-standards
Стандарты кода BSL: именование, запросы, коллекции.
anti_patterns
Критические антипаттерны 1С: запрос в цикле, реквизиты через точку.
bsl-ssl
Переиспользование БСП, разметка правок типовых модулей, устаревшие объекты.
edt-form-xml-requirements
Требования EDT к XML-формам (Form.form): extInfo, дефолты полей.
sdd-workflow
Specification-Driven Development: 9-фазный workflow разработки.
1c-report-direct-query
Прямой запрос в отчётах 1С (СКД) без схемы компоновки.