|
30 | 30 | import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
31 | 31 |
|
32 | 32 | /**
|
33 |
| - * Tests for {@link DelegatingAuthorizationManager}. |
| 33 | + * Tests for {@link RequestMatcherDelegatingAuthorizationManager}. |
34 | 34 | *
|
35 | 35 | * @author Evgeniy Cheban
|
36 | 36 | */
|
37 |
| -public class DelegatingAuthorizationManagerTests { |
| 37 | +public class RequestMatcherDelegatingAuthorizationManagerTests { |
38 | 38 |
|
39 | 39 | @Test
|
40 | 40 | public void buildWhenMappingsEmptyThenException() {
|
41 |
| - assertThatIllegalArgumentException().isThrownBy(() -> DelegatingAuthorizationManager.builder().build()) |
| 41 | + assertThatIllegalArgumentException() |
| 42 | + .isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder().build()) |
42 | 43 | .withMessage("mappings cannot be empty");
|
43 | 44 | }
|
44 | 45 |
|
45 | 46 | @Test
|
46 | 47 | public void addWhenMatcherNullThenException() {
|
47 | 48 | assertThatIllegalArgumentException()
|
48 |
| - .isThrownBy(() -> DelegatingAuthorizationManager.builder() |
| 49 | + .isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder() |
49 | 50 | .add(null, (a, o) -> new AuthorizationDecision(true)).build())
|
50 | 51 | .withMessage("matcher cannot be null");
|
51 | 52 | }
|
52 | 53 |
|
53 | 54 | @Test
|
54 | 55 | public void addWhenManagerNullThenException() {
|
55 |
| - assertThatIllegalArgumentException().isThrownBy( |
56 |
| - () -> DelegatingAuthorizationManager.builder().add(new MvcRequestMatcher(null, "/grant"), null).build()) |
| 56 | + assertThatIllegalArgumentException() |
| 57 | + .isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder() |
| 58 | + .add(new MvcRequestMatcher(null, "/grant"), null).build()) |
57 | 59 | .withMessage("manager cannot be null");
|
58 | 60 | }
|
59 | 61 |
|
60 | 62 | @Test
|
61 | 63 | public void checkWhenMultipleMappingsConfiguredThenDelegatesMatchingManager() {
|
62 |
| - DelegatingAuthorizationManager manager = DelegatingAuthorizationManager.builder() |
| 64 | + RequestMatcherDelegatingAuthorizationManager manager = RequestMatcherDelegatingAuthorizationManager.builder() |
63 | 65 | .add(new MvcRequestMatcher(null, "/grant"), (a, o) -> new AuthorizationDecision(true))
|
64 | 66 | .add(new MvcRequestMatcher(null, "/deny"), (a, o) -> new AuthorizationDecision(false))
|
65 | 67 | .add(new MvcRequestMatcher(null, "/neutral"), (a, o) -> null).build();
|
|
0 commit comments