|
18 | 18 | import org.junit.Test;
|
19 | 19 |
|
20 | 20 | import static org.assertj.core.api.Assertions.assertThat;
|
21 |
| -import static org.assertj.core.api.Assertions.assertThatThrownBy; |
| 21 | +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; |
22 | 22 |
|
23 | 23 | /**
|
24 | 24 | * Tests for {@link ProviderSettings}.
|
@@ -78,48 +78,48 @@ public void settingWhenCustomThenReturnAllSettings() {
|
78 | 78 | @Test
|
79 | 79 | public void issuerWhenNullThenThrowIllegalArgumentException() {
|
80 | 80 | ProviderSettings settings = new ProviderSettings();
|
81 |
| - assertThatThrownBy(() -> settings.issuer(null)) |
82 |
| - .isInstanceOf(IllegalArgumentException.class) |
83 |
| - .hasMessage("value cannot be null"); |
| 81 | + assertThatIllegalArgumentException() |
| 82 | + .isThrownBy(() -> settings.issuer(null)) |
| 83 | + .withMessage("value cannot be null"); |
84 | 84 | }
|
85 | 85 |
|
86 | 86 | @Test
|
87 | 87 | public void authorizationEndpointWhenNullThenThrowIllegalArgumentException() {
|
88 | 88 | ProviderSettings settings = new ProviderSettings();
|
89 |
| - assertThatThrownBy(() -> settings.authorizationEndpoint(null)) |
90 |
| - .isInstanceOf(IllegalArgumentException.class) |
91 |
| - .hasMessage("value cannot be null"); |
| 89 | + assertThatIllegalArgumentException() |
| 90 | + .isThrownBy(() -> settings.authorizationEndpoint(null)) |
| 91 | + .withMessage("value cannot be null"); |
92 | 92 | }
|
93 | 93 |
|
94 | 94 | @Test
|
95 | 95 | public void tokenEndpointWhenNullThenThrowIllegalArgumentException() {
|
96 | 96 | ProviderSettings settings = new ProviderSettings();
|
97 |
| - assertThatThrownBy(() -> settings.tokenEndpoint(null)) |
98 |
| - .isInstanceOf(IllegalArgumentException.class) |
99 |
| - .hasMessage("value cannot be null"); |
| 97 | + assertThatIllegalArgumentException() |
| 98 | + .isThrownBy(() -> settings.tokenEndpoint(null)) |
| 99 | + .withMessage("value cannot be null"); |
100 | 100 | }
|
101 | 101 |
|
102 | 102 | @Test
|
103 | 103 | public void tokenRevocationEndpointWhenNullThenThrowIllegalArgumentException() {
|
104 | 104 | ProviderSettings settings = new ProviderSettings();
|
105 |
| - assertThatThrownBy(() -> settings.tokenRevocationEndpoint(null)) |
106 |
| - .isInstanceOf(IllegalArgumentException.class) |
107 |
| - .hasMessage("value cannot be null"); |
| 105 | + assertThatIllegalArgumentException() |
| 106 | + .isThrownBy(() -> settings.tokenRevocationEndpoint(null)) |
| 107 | + .withMessage("value cannot be null"); |
108 | 108 | }
|
109 | 109 |
|
110 | 110 | @Test
|
111 | 111 | public void tokenIntrospectionEndpointWhenNullThenThrowIllegalArgumentException() {
|
112 | 112 | ProviderSettings settings = new ProviderSettings();
|
113 |
| - assertThatThrownBy(() -> settings.tokenIntrospectionEndpoint(null)) |
114 |
| - .isInstanceOf(IllegalArgumentException.class) |
115 |
| - .hasMessage("value cannot be null"); |
| 113 | + assertThatIllegalArgumentException() |
| 114 | + .isThrownBy(() -> settings.tokenIntrospectionEndpoint(null)) |
| 115 | + .withMessage("value cannot be null"); |
116 | 116 | }
|
117 | 117 |
|
118 | 118 | @Test
|
119 | 119 | public void jwksEndpointWhenNullThenThrowIllegalArgumentException() {
|
120 | 120 | ProviderSettings settings = new ProviderSettings();
|
121 |
| - assertThatThrownBy(() -> settings.jwkSetEndpoint(null)) |
122 |
| - .isInstanceOf(IllegalArgumentException.class) |
123 |
| - .hasMessage("value cannot be null"); |
| 121 | + assertThatIllegalArgumentException() |
| 122 | + .isThrownBy(() -> settings.jwkSetEndpoint(null)) |
| 123 | + .withMessage("value cannot be null"); |
124 | 124 | }
|
125 | 125 | }
|
0 commit comments