You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
why? Because IntelliJ is not supporting it well in every case (e.g. long parameters lists etc)
and I don't want to fight this. Most of other java devs prefer spaces... so let it be :)
The decoder reads back via `ctx.metadata()`, not `ctx.buffer(n)`.
198
220
199
221
## Testing
200
222
201
-
- Every feature needs unit tests covering: happy path, negative cases (invalid input, error conditions), and corner cases (empty, zero, max values, boundary conditions).
223
+
- Every feature needs unit tests covering: happy path, negative cases (invalid input, error conditions), and corner
224
+
cases (empty, zero, max values, boundary conditions).
202
225
- Unit tests must be fast — no file I/O, no network, no sleep. Mock or use in-memory data.
203
-
- Integration tests are critical: there is no formal spec, so interoperability with the Rust reference implementation is the ground truth. Write integration tests for every encoding round-trip and file format boundary.
226
+
- Integration tests are critical: there is no formal spec, so interoperability with the Rust reference implementation is
227
+
the ground truth. Write integration tests for every encoding round-trip and file format boundary.
204
228
- JUnit 5 + Mockito (BDDMockito) + AssertJ.
205
229
- Every test has `// Given` / `// When` / `// Then` sections.
206
230
- Class under test is always named `sut`.
207
231
- Use `BDDMockito` exclusively: `given(mock.method()).willReturn(value)`. Never the reverse form. Only static-import
208
232
`given` and `then` — not `willReturn`/`willThrow`.
209
233
- Prefer `@ParameterizedTest` over copy-pasting tests. Use `@ValueSource` when possible; `@ArgumentsSource` when more
210
234
structure needed (test case must have a name).
211
-
- Use `@ParameterizedTest` with seeded random generators for encoding/decoding logic where input space is large — they find corner cases that example tests miss.
235
+
- Use `@ParameterizedTest` with seeded random generators for encoding/decoding logic where input space is large — they
236
+
find corner cases that example tests miss.
212
237
- Acceptance tests run the built jar end-to-end with hosh scripts.
213
238
- Use `@Nested` to group related tests by scenario or feature within a test class:
214
239
```java
@@ -222,15 +247,18 @@ The decoder reads back via `ctx.metadata()`, not `ctx.buffer(n)`.
222
247
223
248
## Random-data parameterized tests
224
249
225
-
Use `@ParameterizedTest` + `@MethodSource` for random-input coverage. Put generators in `RandomArrays` (integration module)
250
+
Use `@ParameterizedTest` + `@MethodSource` for random-input coverage. Put generators in `RandomArrays` (integration
251
+
module)
226
252
or a similar utility class. Static provider methods in the test class delegate to the generator:
0 commit comments