Skip to content

Commit 234cbe2

Browse files
committed
fix SpringCodegenTest
1 parent 8bf12cf commit 234cbe2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -714,13 +714,13 @@ public void testMultipartBoot() throws IOException {
714714

715715
// Check that the delegate handles the array
716716
JavaFileAssert.assertThat(files.get("MultipartArrayApiDelegate.java"))
717-
.assertMethod("multipartArray", "List<MultipartFile>")
718-
.hasParameter("files").withType("List<MultipartFile>");
717+
.assertMethod("multipartArray", "List<org.springframework.core.io.Resource>")
718+
.hasParameter("files").withType("List<org.springframework.core.io.Resource>");
719719

720720
// Check that the api handles the array
721721
JavaFileAssert.assertThat(files.get("MultipartArrayApi.java"))
722-
.assertMethod("multipartArray", "List<MultipartFile>")
723-
.hasParameter("files").withType("List<MultipartFile>")
722+
.assertMethod("multipartArray", "List<org.springframework.core.io.Resource>")
723+
.hasParameter("files").withType("List<org.springframework.core.io.Resource>")
724724
.assertParameterAnnotations()
725725
.containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\""))
726726
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false"));
@@ -734,22 +734,22 @@ public void testMultipartBoot() throws IOException {
734734

735735
// Check that the api handles the single file
736736
JavaFileAssert.assertThat(files.get("MultipartSingleApi.java"))
737-
.assertMethod("multipartSingle", "MultipartFile")
738-
.hasParameter("file").withType("MultipartFile")
737+
.assertMethod("multipartSingle", "org.springframework.core.io.Resource")
738+
.hasParameter("file").withType("org.springframework.core.io.Resource")
739739
.assertParameterAnnotations()
740740
.containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\""))
741741
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false"));
742742

743743
// Check that api validates mixed multipart request
744744
JavaFileAssert.assertThat(files.get("MultipartMixedApi.java"))
745-
.assertMethod("multipartMixed", "MultipartMixedStatus", "MultipartFile", "MultipartMixedRequestMarker", "List<MultipartMixedStatus>")
745+
.assertMethod("multipartMixed", "MultipartMixedStatus", "org.springframework.core.io.Resource", "MultipartMixedRequestMarker", "List<MultipartMixedStatus>")
746746
.hasParameter("status").withType("MultipartMixedStatus")
747747
.assertParameterAnnotations()
748748
.containsWithName("Valid")
749749
.containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\""))
750750
.containsWithNameAndAttributes("RequestParam", ImmutableMap.of("value", "\"status\"", "required", "true"))
751751
.toParameter().toMethod()
752-
.hasParameter("file").withType("MultipartFile")
752+
.hasParameter("file").withType("org.springframework.core.io.Resource")
753753
.assertParameterAnnotations()
754754
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "true"))
755755
.toParameter().toMethod()
@@ -1488,8 +1488,8 @@ public void shouldEscapeReservedKeyWordsForRequestParameters_7506_Regression() t
14881488
final Map<String, File> files = generateFiles(codegen, "src/test/resources/3_0/issue7506.yaml");
14891489

14901490
final File multipartArrayApiDelegate = files.get("ExampleApi.java");
1491-
assertFileContains(multipartArrayApiDelegate.toPath(), "@RequestPart(value = \"super\", required = false) MultipartFile _super");
1492-
assertFileContains(multipartArrayApiDelegate.toPath(), "@RequestPart(value = \"package\", required = false) MultipartFile _package");
1491+
assertFileContains(multipartArrayApiDelegate.toPath(), "@RequestPart(value = \"super\", required = false) org.springframework.core.io.Resource _super");
1492+
assertFileContains(multipartArrayApiDelegate.toPath(), "@RequestPart(value = \"package\", required = false) org.springframework.core.io.Resource _package");
14931493
}
14941494

14951495
@Test

0 commit comments

Comments
 (0)