@@ -0,0 +1,2901 @@
+package org.jabref.logic.cleanup;%0A%0Aimport java.util.stream.Stream;%0A%0Aimport org.jabref.model.entry.BibEntry;%0Aimport org.jabref.model.entry.field.StandardField;%0Aimport org.jabref.model.entry.field.UnknownField;%0A%0Aimport org.junit.jupiter.params.ParameterizedTest;%0Aimport org.junit.jupiter.params.provider.Arguments;%0Aimport org.junit.jupiter.params.provider.MethodSource;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0A%0Apublic class DoiCleanupTest %7B%0A%0A    @ParameterizedTest%0A    @MethodSource(%22provideDoiForAllLowers%22)%0A    public void testChangeDoi(BibEntry expected, BibEntry doiInfoField) %7B%0A        DoiCleanup cleanUp = new DoiCleanup();%0A        cleanUp.cleanup(doiInfoField);%0A%0A        assertEquals(expected, doiInfoField);%0A    %7D%0A%0A    private static Stream%3CArguments%3E provideDoiForAllLowers() %7B%0A        UnknownField unknownField = new UnknownField(%22ee%22);%0A        BibEntry doiResult = new BibEntry().withField(StandardField.DOI, %2210.1145/2594455%22);%0A%0A        return Stream.of(%0A                // cleanup for Doi field only%0A                Arguments.of(doiResult, new BibEntry().withField(%0A                        StandardField.URL, %22https://doi.org/10.1145/2594455%22)),%0A%0A                // cleanup with Doi and URL to all entries%0A                Arguments.of(doiResult, new BibEntry()%0A                        .withField(StandardField.DOI, %2210.1145/2594455%22)%0A                        .withField(StandardField.URL, %22https://doi.org/10.1145/2594455%22)%0A                        .withField(StandardField.NOTE, %22https://doi.org/10.1145/2594455%22)%0A                        .withField(unknownField, %22https://doi.org/10.1145/2594455%22)),%0A%0A                // cleanup with Doi and no URL to entries%0A                Arguments.of(%0A                        new BibEntry()%0A                        .withField(StandardField.DOI, %2210.1145/2594455%22)%0A                        .withField(StandardField.NOTE, %22This is a random note to this Doi%22)%0A                        .withField(unknownField, %22This is a random ee field for this Doi%22),%0A                        new BibEntry()%0A                        .withField(StandardField.DOI, %2210.1145/2594455%22)%0A                        .withField(StandardField.NOTE, %22This is a random note to this Doi%22)%0A                        .withField(unknownField, %22This is a random ee field for this Doi%22)),%0A%0A                // cleanup with spaced Doi%0A                Arguments.of(doiResult, new BibEntry()%0A                        .withField(StandardField.DOI, %2210.1145 / 2594455%22)),%0A%0A                // cleanup just Note field with URL%0A                Arguments.of(doiResult, new BibEntry()%0A                        .withField(StandardField.NOTE, %22https://doi.org/10.1145/2594455%22)),%0A%0A                // cleanup just ee field with URL%0A                Arguments.of(doiResult, new BibEntry()%0A                        .withField(unknownField, %22https://doi.org/10.1145/2594455%22))%0A        );%0A    %7D%0A%0A%7D%0A

Add Tests to DoiCleanup (#8124)