|
@@ -28,6 +28,7 @@ import java.util.UUID;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
+import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
|
|
import static org.assertj.core.api.Assertions.assertThatNoException;
|
|
|
|
|
|
/**
|
|
@@ -100,6 +101,15 @@ class InMemoryOneTimeTokenServiceTests {
|
|
|
// @formatter:on
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void setClockWhenNullThenThrowIllegalArgumentException() {
|
|
|
+ // @formatter:off
|
|
|
+ assertThatIllegalArgumentException()
|
|
|
+ .isThrownBy(() -> this.oneTimeTokenService.setClock(null))
|
|
|
+ .withMessage("clock cannot be null");
|
|
|
+ // @formatter:on
|
|
|
+ }
|
|
|
+
|
|
|
private List<OneTimeToken> generate(int howMany) {
|
|
|
List<OneTimeToken> generated = new ArrayList<>(howMany);
|
|
|
for (int i = 0; i < howMany; i++) {
|