package org.jabref.model.entry.identifier;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class IacrEprintTest {

    @Test
    public void acceptPlainIacrEprint() {
        assertEquals("2019/001", new IacrEprint("2019/001").getNormalized());
    }

    @Test
    public void ignoreLeadingAndTrailingWhitespaces() {
        assertEquals("2019/001", new IacrEprint(" 2019/001   ").getNormalized());
    }

    @Test
    public void rejectInvalidIacrEprint() {
        assertThrows(IllegalArgumentException.class, () -> new IacrEprint("2021/12"));
    }

    @Test
    public void acceptFullUrlIacrEprint() {
        assertEquals("2019/001", new IacrEprint("https://eprint.iacr.org/2019/001").getNormalized());
    }

    @Test
    public void acceptShortenedUrlIacrEprint() {
        assertEquals("2019/001", new IacrEprint("https://ia.cr/2019/001").getNormalized());
    }

    @Test
    public void acceptDomainUrlIacrEprint() {
        assertEquals("2019/001", new IacrEprint("eprint.iacr.org/2019/001").getNormalized());
    }

    @Test
    public void acceptShortenedDomainUrlIacrEprint() {
        assertEquals("2019/001", new IacrEprint("ia.cr/2019/001").getNormalized());
    }

    @Test
    public void constructValidIacrEprintUrl() {
        assertEquals("https://ia.cr/2019/001", new IacrEprint("2019/001").getAsciiUrl());
    }

}

@@ -48,34 +48,225 @@
 ort 
-org.junit.jupiter.api.Test
+java.util.stream.Stream;%0A%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.params.ParameterizedTest;%0Aimport org.junit.jupiter.params.provider.Arguments;%0Aimport org.junit.jupiter.params.provider.MethodSource
 ;%0A%0Ai
@@ -422,38 +422,157 @@
  %7B%0A%0A    
-@Test%0A    public void 
+private static Stream%3CArguments%3E provideTestData() %7B%0A        return Stream.of(%0A                Arguments.arguments(%0A                        %22
 acceptPl
@@ -576,36 +576,34 @@
 tPlainIacrEprint
-() %7B
+%22,
 %0A        assertE
@@ -599,32 +599,23 @@
     
-assertEquals(%222019/001%22,
+               
  new
@@ -657,116 +657,151 @@
 ed()
-);%0A    %7D%0A%0A    @Test%0A    public void ignoreLeadingAndTrailingWhitespaces() %7B%0A        assertEquals(%222019/001%22,
+%0A                ),%0A                Arguments.arguments(%0A                        %22ignoreLeadingAndTrailingWhitespaces%22,%0A                       
  new
@@ -847,57 +847,103 @@
 ed()
-);
 %0A    
-%7D%0A%0A    @Test%0A    public void rejectInvalid
+            ),%0A                Arguments.arguments(%0A                        %22acceptFullUrl
 Iacr
@@ -944,37 +944,36 @@
 rlIacrEprint
-() %7B%0A
+%22,%0A 
         
 assertThrows
@@ -964,130 +964,376 @@
     
-assertThrows(IllegalArgumentException.class, () -%3E new IacrEprint(%222021/12%22));%0A    %7D%0A%0A    @Test%0A    public void acceptFull
+               new IacrEprint(%22https://eprint.iacr.org/2019/001%22).getNormalized()%0A                ),%0A                Arguments.arguments(%0A                        %22acceptShortenedUrlIacrEprint%22,%0A                        new IacrEprint(%22https://ia.cr/2019/001%22).getNormalized()%0A                ),%0A                Arguments.arguments(%0A                        %22acceptDomain
 UrlI
@@ -1333,36 +1333,34 @@
 ainUrlIacrEprint
-() %7B
+%22,
 %0A        assertE
@@ -1356,32 +1356,23 @@
     
-assertEquals(%222019/001%22,
+               
  new
@@ -1380,32 +1380,24 @@
 IacrEprint(%22
-https://
 eprint.iacr.
@@ -1430,44 +1430,90 @@
 ed()
-);%0A    %7D%0A%0A    @Test%0A    public void 
+%0A                ),%0A                Arguments.arguments(%0A                        %22
 acce
@@ -1515,32 +1515,38 @@
 %22acceptShortened
+Domain
 UrlIacrEprint() 
@@ -1546,45 +1546,34 @@
 rint
-() %7B%0A        assertEquals(%222019/001%22,
+%22,%0A                       
  new
@@ -1581,32 +1581,24 @@
 IacrEprint(%22
-https://
 ia.cr/2019/0
@@ -1609,32 +1609,59 @@
 .getNormalized()
+%0A                )%0A        
 );%0A    %7D%0A%0A    @T
@@ -1680,31 +1680,29 @@
 ic void 
-acceptDomainUrl
+rejectInvalid
 IacrEpri
@@ -1726,241 +1726,283 @@
 sert
-Equals(%222019/001%22, new IacrEprint(%22eprint.iacr.org/2019/001%22).getNormalized());%0A    %7D%0A%0A    @Test%0A    public void acceptShortenedDomainUrlIacrEprint() %7B%0A        assertEquals(%222019/001%22, new IacrEprint(%22ia.cr/2019/001%22).getNormalized()
+Throws(IllegalArgumentException.class, () -%3E new IacrEprint(%222021/12%22));%0A    %7D%0A%0A    @ParameterizedTest(name = %22%7Bindex%7D %7B0%7D%22)%0A    @MethodSource(%22provideTestData%22)%0A    public void acceptCorrectIacrEprintIdentifier(String name, String arg) %7B%0A        assertEquals(%222019/001%22, arg
 );%0A 

convert to parametrized test