-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace AUTO with preferredAnnotationLibrary
- Loading branch information
1 parent
b7160a1
commit 75a722c
Showing
3 changed files
with
27 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 22 additions & 22 deletions
44
...t/java/org/openapitools/codegen/languages/features/DocumentationProviderFeaturesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
package org.openapitools.codegen.languages.features; | ||
|
||
import java.io.PrintWriter; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Locale; | ||
import java.util.stream.Collectors; | ||
import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.AnnotationLibrary; | ||
import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DocumentationProvider; | ||
import org.testng.annotations.AfterTest; | ||
import org.testng.annotations.Test; | ||
|
||
public class DocumentationProviderFeaturesTest { | ||
|
||
PrintWriter writer = new PrintWriter(System.out); | ||
|
||
@AfterTest | ||
void flush() { | ||
writer.flush(); | ||
} | ||
|
||
@Test(priority = 0) | ||
void generateDocumentationProviderTable() { | ||
writer.println("### DocumentationProvider\n"); | ||
writer.println("|Cli Option|Description|Property Name|Preferred Annotation Library|Supported Annotation Libraries|"); | ||
writer.println("|----------|-----------|-------------|----------------------------|------------------------------|"); | ||
List<DocumentationProvider> providers = Arrays.asList(DocumentationProvider.values()); | ||
providers.forEach(dp -> writer.printf("|**%s**|%s|`%s`|%s|%s|\n", | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("### DocumentationProvider\n"); | ||
sb.append("|Cli Option|Description|Property Name|Preferred Annotation Library|Supported Annotation Libraries|\n"); | ||
sb.append("|----------|-----------|-------------|----------------------------|------------------------------|\n"); | ||
providers.forEach(dp -> sb.append(String.format(Locale.ROOT, "|**%s**|%s|`%s`|%s|%s|\n", | ||
dp.toCliOptValue(), | ||
dp.getDescription(), | ||
dp.getPropertyName(), | ||
dp.getPreferredAnnotationLibrary().toCliOptValue(), | ||
dp.supportedAnnotationLibraries().stream().map(AnnotationLibrary::toCliOptValue).collect(Collectors.joining(", ")) | ||
)); | ||
writer.println(); | ||
dp.supportedAnnotationLibraries().stream() | ||
.map(AnnotationLibrary::toCliOptValue) | ||
.collect(Collectors.joining(", ")) | ||
))); | ||
sb.append("\n"); | ||
|
||
System.out.println(sb); | ||
} | ||
|
||
@Test(priority = 1) | ||
void generateAnnotationLibraryTable() { | ||
writer.println("### AnnotationLibrary\n"); | ||
writer.println("|Cli Option|Description|Property Name|"); | ||
writer.println("|----------|-----------|-----------|"); | ||
List<AnnotationLibrary> libraries = Arrays.asList(AnnotationLibrary.values()); | ||
libraries.forEach(dp -> writer.printf("|**%s**|%s|`%s`|\n", | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("### AnnotationLibrary\n"); | ||
sb.append("|Cli Option|Description|Property Name|\n"); | ||
sb.append("|----------|-----------|-----------|\n"); | ||
libraries.forEach(dp -> sb.append(String.format(Locale.ROOT, "|**%s**|%s|`%s`|\n", | ||
dp.toCliOptValue(), | ||
dp.getDescription(), | ||
dp.getPropertyName() | ||
)); | ||
writer.println(); | ||
))); | ||
sb.append("\n"); | ||
|
||
System.out.println(sb); | ||
} | ||
} |