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

Refactor processCitation in GrobidService to match processPdf #8003

Merged
merged 6 commits into from
Aug 20, 2021

Conversation

btut
Copy link
Contributor

@btut btut commented Aug 20, 2021

GrobidService.processCitation now returns an Optional to match the signature of processPDF.
This also makes the tests more expressive, as we can compare the BibEntry to an expected BibEntry instead of comparing Strings.

  • [] Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • [] Screenshots added in PR description (for UI changes)
  • [] Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@btut btut self-assigned this Aug 20, 2021
@btut btut requested a review from Siedlerchr August 20, 2021 06:59
@btut btut added project: gsoc status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Aug 20, 2021
Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

At least better than assertTrue. I would prefer if the response deliverd by the processCitaiton would be directly a BibEntry instead of a string, so you could compare two bib entries:

@btut
Copy link
Contributor Author

btut commented Aug 20, 2021

At least better than assertTrue. I would prefer if the response deliverd by the processCitaiton would be directly a BibEntry instead of a string, so you could compare two bib entries:

I agree that would make it more consistent with processPDF, so I changed it.

@btut btut changed the title Avoid assertTrue in GrobidServiceTest Refactor processCitation in GrobidService to match processPdf Aug 20, 2021
@btut btut requested a review from Siedlerchr August 20, 2021 08:44
import org.jabref.testutils.category.FetcherTest;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.Answers;

import static org.junit.Assert.assertTrue;
Copy link
Member

Choose a reason for hiding this comment

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

You have the wrong junit, it. must be import static org.junit.jupiter.api.Assertions.assertTrue;

@Siedlerchr Siedlerchr merged commit e5cd306 into JabRef:main Aug 20, 2021
@Siedlerchr
Copy link
Member

Much better now! :)

Siedlerchr added a commit that referenced this pull request Aug 20, 2021
* upstream/main: (110 commits)
  Extract PushTo names into model (#8005)
  Refactor processCitation in GrobidService to match processPdf (#8003)
  Improved progress indication for fulltext-index operations (#7981)
  Reordered Pdf-Importer priorities (#8001)
  Implement more pdf importers (#7947)
  Adding icon picker for group dialog issue#6142 (#7776)
  Fix possible NPE in exporter with empty charset (#7979)
  Fix icon color (#7994)
  Bump slf4j-api from 2.0.0-alpha2 to 2.0.0-alpha4 (#7991)
  Bump classgraph from 4.8.112 to 4.8.114 (#7990)
  Bump mariadb-java-client from 2.7.3 to 2.7.4 (#7992)
  Bump jsoup from 1.14.1 to 1.14.2 (#7993)
  New yaml issue template (#7983)
  [Bot] Update CSL styles (#7985)
  Reordered items in main table right-click menu (#7952)
  Fulltext Index: Only index local pdf files (#7980)
  Bump WyriHaximus/github-action-wait-for-status from 1.3 to 1.4 (#7973)
  Bump byte-buddy-parent from 1.11.9 to 1.11.12 (#7974)
  Bump classgraph from 4.8.110 to 4.8.112 (#7975)
  Bump checkstyle from 8.45 to 8.45.1 (#7978)
  ...

# Conflicts:
#	src/main/java/module-info.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: gsoc status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants