29 lines
775 B
Java
29 lines
775 B
Java
package de.nclazz.service.mailrelay.domain;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import java.util.List;
|
|
import java.util.UUID;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
class RelayTest {
|
|
|
|
@Test
|
|
void addAccountAddsAccountToRelay() {
|
|
RelayAccount account = new RelayAccount(
|
|
UUID.randomUUID(),
|
|
"relay account name",
|
|
"may-token",
|
|
List.of("vip@account.com")
|
|
);
|
|
|
|
FakeRelayAccountRepository repository = new FakeRelayAccountRepository();
|
|
Relay relay = new Relay(repository, new FakeMessageRepository());
|
|
relay.addAccount(account);
|
|
|
|
assertThat(repository.findAll())
|
|
.hasSize(1)
|
|
.containsExactly(account);
|
|
}
|
|
} |