Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace doesNotContains and Collectors.joining() #754

Closed

Conversation

rivkode
Copy link

@rivkode rivkode commented May 23, 2024

  • [refactor: Collectors.joining() -> String.join()]
  • [fix : doesNotContain -> contains]

issue link

@rivkode rivkode changed the title Refactor/pdf stream join Replace doesNotContains and Collectors.joining() May 23, 2024
Comment on lines 55 to 56
assertThat(allText).contains(
List.of("Page 1 of 4", "Page 2 of 4", "Page 3 of 4", "Page 4 of 4", "PDF Bookmark Sample"));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before

image

After

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests are passing with doesNotContain, the purpose of this test is to verify that the headers/footers were excluded. I don't understand how you see the failing test, the CI is green with respect to this test.

Copy link
Author

@rivkode rivkode May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the ExtractedTextFormatterTests class and it seems to be a "\n" problem.

Window: "\r\n"
Linux or Mac: "\n"

I think it's because System.lineSeparator() works in a different way between Windows and Linux or Mac OS.
I will figure it out how this code works on windows as well.

Copy link
Author

@rivkode rivkode May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my idea, but when I did some research into why the test was failing, I guess that the reason I was confused was because the name of the method was unclear.

How about changing the method name like this as below ?
If we've already discussed the method name, please ignore it

  • classPathRead() -> excludeHeadersAndFootersPdfPages()
  • classPathRead() -> withoutHeadersAndFooters()
  • other

@tzolov
Copy link
Collaborator

tzolov commented Jun 15, 2024

Nothing to change

@tzolov tzolov closed this Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants