Skip to content

Commit

Permalink
Integrate DOI parsing special character test in existing parameterize…
Browse files Browse the repository at this point in the history
…d test (#11603)

* Integrate test in existing parameterized test

* Update src/test/java/org/jabref/model/entry/identifier/DOITest.java

Co-authored-by: Christoph <siedlerkiller@gmail.com>

* fix brace

---------

Co-authored-by: Christoph <siedlerkiller@gmail.com>
  • Loading branch information
subhramit and Siedlerchr authored Aug 11, 2024
1 parent c3a21ec commit 6b39197
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/test/java/org/jabref/model/entry/identifier/DOITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ private static Stream<Arguments> testData() {
Arguments.of("10/abcde", DOI.findInText("other stuff https://www.doi.org/abcde end").get().getDOI()),
Arguments.of("10/abcde", DOI.findInText("other stuff https://doi.org/abcde end").get().getDOI()),
Arguments.of("10.5220/0010404301780189", DOI.findInText("https://www.scitepress.org/Link.aspx?doi=10.5220/0010404301780189").get().getDOI()),
Arguments.of("10.5220/0010404301780189", DOI.findInText("10.5220/0010404301780189").get().getDOI())
Arguments.of("10.5220/0010404301780189", DOI.findInText("10.5220/0010404301780189").get().getDOI()),

// findDoiWithSpecialCharactersInText
Arguments.of("10.1175/1520-0493(2002)130%3C1913:EDAWPO%3E2.0.CO;2",
DOI.findInText("https://doi.org/10.1175/1520-0493(2002)130%3C1913:EDAWPO%3E2.0.CO;2").get().getDOI())
);
}

Expand Down Expand Up @@ -316,10 +320,4 @@ public void rejectMissingDividerInShortDoi() {
public void rejectNullDoiParameter() {
assertThrows(NullPointerException.class, () -> new DOI(null));
}

@Test
public void findDoiWithSpecialCharactersInText() {
assertEquals(Optional.of(new DOI("10.1175/1520-0493(2002)130%3C1913:EDAWPO%3E2.0.CO;2")),
DOI.findInText("https://doi.org/10.1175/1520-0493(2002)130%3C1913:EDAWPO%3E2.0.CO;2"));
}
}

0 comments on commit 6b39197

Please sign in to comment.