-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1701 from lnash94/fixes
[master]Fix doc comment override issue
- Loading branch information
Showing
2 changed files
with
28 additions
and
8 deletions.
There are no files selected for viewing
21 changes: 17 additions & 4 deletions
21
openapi-cli/src/test/java/io/ballerina/openapi/generators/common/DocCommenTests.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,15 +1,28 @@ | ||
package io.ballerina.openapi.generators.common; | ||
|
||
import io.ballerina.openapi.core.generators.common.GeneratorUtils; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
public class DocCommenTests { | ||
@Test() | ||
public void testForFunctionReplaceContentWithinBrackets() { | ||
// need ot improve regex to capture abc.json | ||
// Assert.assertEquals("admin/api/ZZZ/customers/XXX/abc.json", | ||
// todo : need ot improve regex to capture `.` in string ex: abc.json | ||
// Assert.assertEquals("admin/api/ZZZ/customers/XXX/ZZZ", | ||
// GeneratorUtils.replaceContentWithinBrackets("admin/api/2021-10/customers/{customer_id}/abc.json", "XXX")); | ||
// Assert.assertEquals("admin/api/ZZZ/customers/XXX/abc.json", | ||
// GeneratorUtils.replaceContentWithinBrackets( | ||
// Assert.assertEquals("admin/api/ZZZ/customers/XXX/ZZZ", | ||
// GeneratorUtils.replaceContentWithinBrackets( | ||
// "admin/api/'2021\\-10/customers/[string customer_id]/abc\\.json", "XXX")); | ||
|
||
Assert.assertEquals("/user/ssh_signing_keys/XXX", GeneratorUtils.replaceContentWithinBrackets( | ||
"/user/ssh_signing_keys/{ssh_signing_key_id}", "XXX")); | ||
Assert.assertEquals("/user/gpg_keys/XXX", GeneratorUtils.replaceContentWithinBrackets( | ||
"/user/gpg_keys/{gpg_key_id}", "XXX")); | ||
|
||
Assert.assertEquals(GeneratorUtils.replaceContentWithinBrackets("user/gpg_keys/[int gpg_key_id]", | ||
"XXX"), "user/gpg_keys/XXX"); | ||
Assert.assertEquals(GeneratorUtils.replaceContentWithinBrackets( | ||
"user/ssh_signing_keys/[int ssh_signing_key_id]", "XXX"), | ||
"user/ssh_signing_keys/XXX"); | ||
} | ||
} |
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