Skip to content

Conversation

@rivkode
Copy link
Contributor

@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
Contributor 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
Contributor 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
Contributor 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
Contributor

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.

3 participants