spring-projects / spring-projects/spring-ai

TikaDocumentReaderTests misparses CsvSource values containing commas in contentSnipped

Open Beginner friendly
#5,889 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.