|
28 | 28 | import org.springframework.boot.configurationsample.endpoint.CustomPropertiesEndpoint; |
29 | 29 | import org.springframework.boot.configurationsample.endpoint.EnabledEndpoint; |
30 | 30 | import org.springframework.boot.configurationsample.endpoint.NoAccessEndpoint; |
| 31 | +import org.springframework.boot.configurationsample.endpoint.NullableParameterEndpoint; |
| 32 | +import org.springframework.boot.configurationsample.endpoint.OptionalParameterEndpoint; |
31 | 33 | import org.springframework.boot.configurationsample.endpoint.ReadOnlyAccessEndpoint; |
32 | 34 | import org.springframework.boot.configurationsample.endpoint.SimpleEndpoint; |
33 | 35 | import org.springframework.boot.configurationsample.endpoint.SimpleEndpoint2; |
34 | 36 | import org.springframework.boot.configurationsample.endpoint.SimpleEndpoint3; |
35 | 37 | import org.springframework.boot.configurationsample.endpoint.SpecificEndpoint; |
36 | 38 | import org.springframework.boot.configurationsample.endpoint.UnrestrictedAccessEndpoint; |
37 | 39 | import org.springframework.boot.configurationsample.endpoint.incremental.IncrementalEndpoint; |
38 | | -import org.springframework.boot.configurationsample.endpoint.NullableParameterEndpoint; |
39 | | -import org.springframework.boot.configurationsample.endpoint.OptionalParameterEndpoint; |
40 | 40 |
|
41 | 41 | import static org.assertj.core.api.Assertions.assertThat; |
42 | 42 | import static org.assertj.core.api.Assertions.assertThatRuntimeException; |
@@ -196,37 +196,25 @@ void shouldFailIfEndpointWithSameIdButWithConflictingEnabledByDefaultSetting() { |
196 | 196 | } |
197 | 197 |
|
198 | 198 | @Test |
199 | | - void nullableParameterEndpoint() { |
| 199 | + void endpointWithNullableParameter() { |
200 | 200 | ConfigurationMetadata metadata = compile(NullableParameterEndpoint.class); |
201 | | - assertThat(metadata).has(Metadata.withGroup("management.endpoint.nullable").fromSource(NullableParameterEndpoint.class)); |
| 201 | + assertThat(metadata) |
| 202 | + .has(Metadata.withGroup("management.endpoint.nullable").fromSource(NullableParameterEndpoint.class)); |
202 | 203 | assertThat(metadata).has(access("nullable", Access.UNRESTRICTED)); |
203 | 204 | assertThat(metadata).has(cacheTtl("nullable")); |
204 | 205 | assertThat(metadata.getItems()).hasSize(3); |
205 | 206 | } |
206 | 207 |
|
207 | 208 | @Test |
208 | | - void optionalParameterEndpoint() { |
| 209 | + void endpointWithOptionalParameter() { |
209 | 210 | ConfigurationMetadata metadata = compile(OptionalParameterEndpoint.class); |
210 | | - assertThat(metadata).has(Metadata.withGroup("management.endpoint.optional").fromSource(OptionalParameterEndpoint.class)); |
| 211 | + assertThat(metadata) |
| 212 | + .has(Metadata.withGroup("management.endpoint.optional").fromSource(OptionalParameterEndpoint.class)); |
211 | 213 | assertThat(metadata).has(access("optional", Access.UNRESTRICTED)); |
212 | 214 | assertThat(metadata).has(cacheTtl("optional")); |
213 | 215 | assertThat(metadata.getItems()).hasSize(3); |
214 | 216 | } |
215 | 217 |
|
216 | | - @Test |
217 | | - void nullableAndOptionalParameterEquivalence() { |
218 | | - ConfigurationMetadata nullableMetadata = compile(NullableParameterEndpoint.class); |
219 | | - ConfigurationMetadata optionalMetadata = compile(OptionalParameterEndpoint.class); |
220 | | - |
221 | | - assertThat(nullableMetadata.getItems()).hasSize(3); |
222 | | - assertThat(optionalMetadata.getItems()).hasSize(3); |
223 | | - |
224 | | - assertThat(nullableMetadata).has(access("nullable", Access.UNRESTRICTED)); |
225 | | - assertThat(optionalMetadata).has(access("optional", Access.UNRESTRICTED)); |
226 | | - assertThat(nullableMetadata).has(cacheTtl("nullable")); |
227 | | - assertThat(optionalMetadata).has(cacheTtl("optional")); |
228 | | - } |
229 | | - |
230 | 218 | private Metadata.MetadataItemCondition access(String endpointId, Access defaultValue) { |
231 | 219 | return defaultAccess(endpointId, endpointId, defaultValue); |
232 | 220 | } |
|
0 commit comments