|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2022 the original author or authors. |
| 2 | + * Copyright 2002-2023 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -183,6 +183,24 @@ void registerReflectiveHintsForMethodWithRawHttpEntityParameter() throws NoSuchM
|
183 | 183 | typeHint -> assertThat(typeHint.getType()).isEqualTo(TypeReference.of(SampleController.class)));
|
184 | 184 | }
|
185 | 185 |
|
| 186 | + @Test |
| 187 | + void registerReflectiveHintsForMethodWithPartToConvert() throws NoSuchMethodException { |
| 188 | + Method method = SampleController.class.getDeclaredMethod("postPartToConvert", Request.class); |
| 189 | + processor.registerReflectionHints(hints, method); |
| 190 | + assertThat(hints.typeHints()).satisfiesExactlyInAnyOrder( |
| 191 | + typeHint -> assertThat(typeHint.getType()).isEqualTo(TypeReference.of(SampleController.class)), |
| 192 | + typeHint -> { |
| 193 | + assertThat(typeHint.getType()).isEqualTo(TypeReference.of(Request.class)); |
| 194 | + assertThat(typeHint.getMemberCategories()).containsExactlyInAnyOrder( |
| 195 | + MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, |
| 196 | + MemberCategory.DECLARED_FIELDS); |
| 197 | + assertThat(typeHint.methods()).satisfiesExactlyInAnyOrder( |
| 198 | + hint -> assertThat(hint.getName()).isEqualTo("getMessage"), |
| 199 | + hint -> assertThat(hint.getName()).isEqualTo("setMessage")); |
| 200 | + }, |
| 201 | + typeHint -> assertThat(typeHint.getType()).isEqualTo(TypeReference.of(String.class))); |
| 202 | + } |
| 203 | + |
186 | 204 | static class SampleController {
|
187 | 205 |
|
188 | 206 | @GetMapping
|
@@ -225,6 +243,10 @@ void postHttpEntity(HttpEntity<Request> entity) {
|
225 | 243 | void postRawHttpEntity(HttpEntity entity) {
|
226 | 244 | }
|
227 | 245 |
|
| 246 | + @PostMapping |
| 247 | + void postPartToConvert(@RequestPart Request request) { |
| 248 | + } |
| 249 | + |
228 | 250 | }
|
229 | 251 |
|
230 | 252 | @RestController
|
|
0 commit comments