| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I looked at it without AI and it makes sense. Lets see what copilot thinks about it. |
Sorry, something went wrong.
There was a problem hiding this comment.
Adds focused JUnit tests in tika-core to increase behavioral coverage of org.apache.tika.metadata.Metadata, especially around reserved X-TIKA: key guarding and MetadataWriteLimiter delegation semantics.
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| @Test | ||
| public void testWriteLimiterInvokedOnSetProperty() { | ||
| RecordingLimiter limiter = new RecordingLimiter(); | ||
| Metadata m = new Metadata(limiter); | ||
| m.set(TikaCoreProperties.TITLE, "title"); | ||
| assertTrue(limiter.setCalled); | ||
| assertEquals(TikaCoreProperties.TITLE.getName(), limiter.lastSetField); | ||
| assertEquals("title", limiter.lastSetValue); | ||
| } |
Update test for reserved keys in untrusted Metadata.
| Back | FazBrowse Home | New Git URL |
Results
Scope: module tika-core, target production class org.apache.tika.metadata.Metadata, tests org.apache.tika.metadata.TestMetadata. Measured with PIT 1.15.2 (junit5 plugin) under JDK 17, clean test-compile forced before each run.
The added tests kill 4 additional Metadata mutants and eliminate 2 survivors.
What this adds
Six focused unit tests on Metadata, each asserting observable behavior or a documented contract:
Scope
Tests-only. One file changed: tika-core/src/test/java/org/apache/tika/metadata/TestMetadata.java (121 insertions, 0 deletions vs base). No production code, no fixtures, no build changes; Apache license headers unchanged.
Disclosure
This PR was generated with an AI-assisted pipeline built around mutation testing (PIT). The pipeline mutates the target class (flipping conditions and changing boundary/edge cases) and runs the existing tests against each mutant; where a mutant survives (the existing tests do not catch that edge case), it writes a focused test for that case and reruns PIT to confirm the new test actually kills that specific mutant.