spring-projects / spring-projects/spring-ai
TikaDocumentReaderTests misparses CsvSource values containing commas in contentSnipped
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
TikaDocumentReaderTests uses @CsvSource for resourceUri, resourceName, and contentSnipped.
Some contentSnipped values contain commas, for example:
Sed ipsum tortor, fringilla a consectetur eget, cursus posuere sem.Lorem ipsum dolor sit amet, consectetur adipiscing elit.
If the default @CsvSource delimiter is used, those values are split at the comma and contentSnipped is truncated.
This makes the test assert against incomplete snippet values instead of the full expected content.
Affected file:
document-readers/tika-reader/src/test/java/org/springframework/ai/reader/tika/TikaDocumentReaderTests.java
Suggested fix:
Use a non-comma delimiter for @CsvSource, for example delimiter = ';'.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open document-readers/tika-reader/src/test/java/org/springframework/ai/reader/tika/TikaDocumentReaderTests.java and inspect the @CsvSource used for resourceUri, resourceName, and contentSnipped. Change its delimiter from the default comma to the non-comma delimiter described in the issue, then run TikaDocumentReaderTests. Done means values containing commas remain intact and the assertions check the full content snippets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100