mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-20 11:22:05 +01:00
Add sessionKey fromString test
This commit is contained in:
parent
1b1a13e7d0
commit
824b8de404
1 changed files with 13 additions and 0 deletions
|
@ -6,6 +6,7 @@ package sop.util;
|
|||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import sop.SessionKey;
|
||||
|
@ -45,4 +46,16 @@ public class SessionKeyTest {
|
|||
assertNotEquals(s1, null);
|
||||
assertNotEquals(s1, "FCA4BEAF687F48059CACC14FB019125CD57392BAB7037C707835925CBF9F7BCD");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fromString_missingAlgorithmIdThrows() {
|
||||
String missingAlgorithId = "FCA4BEAF687F48059CACC14FB019125CD57392BAB7037C707835925CBF9F7BCD";
|
||||
assertThrows(IllegalArgumentException.class, () -> SessionKey.fromString(missingAlgorithId));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fromString_wrongDivider() {
|
||||
String semicolonDivider = "9;FCA4BEAF687F48059CACC14FB019125CD57392BAB7037C707835925CBF9F7BCD";
|
||||
assertThrows(IllegalArgumentException.class, () -> SessionKey.fromString(semicolonDivider));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue