mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-11 03:09:41 +02:00
Simplify UserIdTests
This commit is contained in:
parent
4c1d359971
commit
837fbd3635
2 changed files with 3 additions and 36 deletions
|
@ -10,25 +10,9 @@ import org.pgpainless.key.util.UserId;
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
public class UserIdTest {
|
||||
|
||||
@Test
|
||||
public void throwForNullName() {
|
||||
assertThrows(IllegalArgumentException.class, () -> UserId.newBuilder().withName(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void throwForNullComment() {
|
||||
assertThrows(IllegalArgumentException.class, () -> UserId.newBuilder().withComment(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void throwForNullEmail() {
|
||||
assertThrows(IllegalArgumentException.class, () -> UserId.newBuilder().withEmail(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormatOnlyName() {
|
||||
assertEquals(
|
||||
|
@ -66,11 +50,6 @@ public class UserIdTest {
|
|||
.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void throwIfOnlyEmailEmailNull() {
|
||||
assertThrows(IllegalArgumentException.class, () -> UserId.onlyEmail(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNameAndEmail() {
|
||||
UserId userId = UserId.nameAndEmail("Maurice Moss", "moss.m@reynholm.co.uk");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue