|
25 | 25 | import org.junit.jupiter.api.BeforeEach;
|
26 | 26 | import org.junit.jupiter.api.Test;
|
27 | 27 |
|
28 |
| -import org.springframework.security.authentication.password.CompromisedPasswordCheckResult; |
| 28 | +import org.springframework.security.authentication.password.CompromisedPasswordDecision; |
29 | 29 | import org.springframework.web.client.RestClient;
|
30 | 30 |
|
31 | 31 | import static org.assertj.core.api.Assertions.assertThat;
|
@@ -69,22 +69,22 @@ void tearDown() throws IOException {
|
69 | 69 | @Test
|
70 | 70 | void checkWhenPasswordIsLeakedThenIsCompromised() throws InterruptedException {
|
71 | 71 | this.server.enqueue(new MockResponse().setBody(this.pwnedPasswords).setResponseCode(200));
|
72 |
| - CompromisedPasswordCheckResult check = this.passwordChecker.check("P@ssw0rd"); |
| 72 | + CompromisedPasswordDecision check = this.passwordChecker.check("P@ssw0rd"); |
73 | 73 | assertThat(check.isCompromised()).isTrue();
|
74 | 74 | assertThat(this.server.takeRequest().getPath()).isEqualTo("/range/21BD1");
|
75 | 75 | }
|
76 | 76 |
|
77 | 77 | @Test
|
78 | 78 | void checkWhenPasswordNotLeakedThenNotCompromised() {
|
79 | 79 | this.server.enqueue(new MockResponse().setBody(this.pwnedPasswords).setResponseCode(200));
|
80 |
| - CompromisedPasswordCheckResult check = this.passwordChecker.check("My1nCr3d!bL3P@SS0W0RD"); |
| 80 | + CompromisedPasswordDecision check = this.passwordChecker.check("My1nCr3d!bL3P@SS0W0RD"); |
81 | 81 | assertThat(check.isCompromised()).isFalse();
|
82 | 82 | }
|
83 | 83 |
|
84 | 84 | @Test
|
85 | 85 | void checkWhenNoPasswordsReturnedFromApiCallThenNotCompromised() {
|
86 | 86 | this.server.enqueue(new MockResponse().setResponseCode(200));
|
87 |
| - CompromisedPasswordCheckResult check = this.passwordChecker.check("123456"); |
| 87 | + CompromisedPasswordDecision check = this.passwordChecker.check("123456"); |
88 | 88 | assertThat(check.isCompromised()).isFalse();
|
89 | 89 | }
|
90 | 90 |
|
|
0 commit comments