@@ -1237,13 +1237,43 @@ public void testValidationsInQueryParams_issue21238_Api_Delegate() throws IOExce
12371237 @ DataProvider
12381238 public Object [][] issue17997DocumentationProviders () {
12391239 return new Object [][]{
1240- {DocumentationProviderFeatures .DocumentationProvider .SPRINGDOC .name ()},
1241- {DocumentationProviderFeatures .DocumentationProvider .SPRINGFOX .name ()},
1240+ {DocumentationProviderFeatures .DocumentationProvider .SPRINGDOC .name (),
1241+ (Consumer <Path >) outputPath ->
1242+ assertFileContains (
1243+ outputPath ,
1244+ "allowableValues = [\" 0\" , \" 1\" ], defaultValue = \" 0\" " ,
1245+ "@PathVariable"
1246+ ),
1247+ (Consumer <Path >) outputPath ->
1248+ assertFileContains (
1249+ outputPath ,
1250+ "allowableValues = [\" sleeping\" , \" awake\" ]" , "@PathVariable" ,
1251+ "@PathVariable"
1252+ )
1253+ },
1254+ {DocumentationProviderFeatures .DocumentationProvider .SPRINGFOX .name (),
1255+ (Consumer <Path >) outputPath ->
1256+ assertFileContains (
1257+ outputPath ,
1258+ "allowableValues = \" 0, 1\" , defaultValue = \" 0\" " ,
1259+ "@PathVariable"
1260+ ),
1261+ (Consumer <Path >) outputPath ->
1262+ assertFileContains (
1263+ outputPath ,
1264+ "allowableValues = \" sleeping, awake\" " , "@PathVariable" ,
1265+ "@PathVariable"
1266+ )
1267+ }
12421268 };
12431269 }
12441270
12451271 @ Test (dataProvider = "issue17997DocumentationProviders" )
1246- public void testDocumentationAnnotationInPathParams_Issue17997 (String documentProvider ) throws IOException {
1272+ public void testDocumentationAnnotationInPathParams_Issue17997 (
1273+ String documentProvider ,
1274+ Consumer <Path > intEnumAssertFunction ,
1275+ Consumer <Path > stringEnumAssertFunction
1276+ ) throws IOException {
12471277 Map <String , Object > additionalProperties = new HashMap <>();
12481278 additionalProperties .put (DOCUMENTATION_PROVIDER , documentProvider );
12491279
@@ -1264,11 +1294,7 @@ public void testDocumentationAnnotationInPathParams_Issue17997(String documentPr
12641294 ).forEach (filename -> {
12651295 File file = files .get (filename );
12661296 assertThat (file ).isNotNull ();
1267- assertFileContains (
1268- file .toPath (),
1269- "allowableValues = [\" 0\" , \" 1\" ], defaultValue = \" 0\" " ,
1270- "@PathVariable"
1271- );
1297+ intEnumAssertFunction .accept (file .toPath ());
12721298 });
12731299
12741300 Stream .of (
@@ -1277,11 +1303,7 @@ public void testDocumentationAnnotationInPathParams_Issue17997(String documentPr
12771303 ).forEach (filename -> {
12781304 File file = files .get (filename );
12791305 assertThat (file ).isNotNull ();
1280- assertFileContains (
1281- file .toPath (),
1282- "allowableValues = [\" sleeping\" , \" awake\" ]" , "@PathVariable" ,
1283- "@PathVariable"
1284- );
1306+ stringEnumAssertFunction .accept (file .toPath ());
12851307 });
12861308 }
12871309
0 commit comments