package eu.europa.esig.dss.jaxb.parsers;

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

import org.junit.jupiter.api.Test;

import eu.europa.esig.dss.enumerations.EncryptionAlgorithm;

public class EncryptionAlgorithmParserTest {

	@Test
	public void testEnum() {
		for (EncryptionAlgorithm ea : EncryptionAlgorithm.values()) {
			String string = EncryptionAlgorithmParser.print(ea);
			assertNotNull(string);
			EncryptionAlgorithm parse = EncryptionAlgorithmParser.parse(string);
			assertEquals(ea, parse);
		}
	}

	@Test
	public void parseAlgos() {
		assertNotNull(EncryptionAlgorithmParser.parse("RSA"));
		assertNotNull(EncryptionAlgorithmParser.parse("DSA"));
		assertNotNull(EncryptionAlgorithmParser.parse("EC"));
		assertNotNull(EncryptionAlgorithmParser.parse("ECC"));
		assertNotNull(EncryptionAlgorithmParser.parse("PLAIN-ECDSA"));
		assertNotNull(EncryptionAlgorithmParser.parse("PLAIN_ECDSA"));
	}
	
	@Test
	public void unsupportedAlgorithmTest() {
		assertThrows(IllegalArgumentException.class, () -> {
			assertNull(EncryptionAlgorithmParser.parse("bla"));
		});
	}

}

@@ -59,38 +59,22 @@
 g.junit.
-jupiter.api.
 Assert
-ions
 .assertE
@@ -104,38 +104,22 @@
 g.junit.
-jupiter.api.
 Assert
-ions
 .assertN
@@ -129,128 +129,8 @@
 ull;
-%0Aimport static org.junit.jupiter.api.Assertions.assertNull;%0Aimport static org.junit.jupiter.api.Assertions.assertThrows;
 %0A%0Aim
@@ -148,20 +148,8 @@
 nit.
-jupiter.api.
 Test
@@ -944,24 +944,67 @@
 %0A%09%7D%0A%09%0A%09@Test
+(expected = IllegalArgumentException.class)
 %0A%09public voi
@@ -1040,75 +1040,8 @@
 %7B%0A%09%09
-assertThrows(IllegalArgumentException.class, () -%3E %7B%0A%09%09%09assertNull(
 Encr
@@ -1078,15 +1078,8 @@
 la%22)
-);%0A%09%09%7D)
 ;%0A%09%7D

build fix