-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-175 Remove description resolver for Descriptions annotation. Fix A…
…nnotatedMember#getAnnotationsByType implementations. (#176) (#176) * Remove description resolver for Descriptions annotation. Fix AnnotatedMember#getAnnotationsByType implementations. Add junit tests for multiline comments for java and kotlin platform. (#175) * Move MultiDescriptionJavaTest to kotlin package.
- Loading branch information
Showing
6 changed files
with
83 additions
and
3 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
42 changes: 42 additions & 0 deletions
42
cdn-tests/src/test/kotlin/net/dzikoysk/cdn/feature/MultiDescriptionJavaTest.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.dzikoysk.cdn.feature; | ||
|
||
import net.dzikoysk.cdn.Cdn; | ||
import net.dzikoysk.cdn.CdnException; | ||
import net.dzikoysk.cdn.CdnFactory; | ||
import net.dzikoysk.cdn.entity.Description; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import panda.std.Result; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static panda.std.ResultAssertions.assertOk; | ||
|
||
class MultiDescriptionJavaTest { | ||
|
||
public static class ConfigurationWithMultiDescription { | ||
|
||
@Description("#") | ||
@Description("# Test multi line banner") | ||
@Description("#") | ||
@Description(" ") | ||
public String value = "test"; | ||
} | ||
|
||
@Test | ||
@DisplayName("should render multiline banner with empty descriptions on java implementation") | ||
void test() { | ||
Cdn standardJava = CdnFactory.createStandard(); | ||
Result<String, CdnException> renderResult = standardJava.render(new ConfigurationWithMultiDescription()); | ||
String render = assertOk(renderResult); | ||
|
||
assertEquals( | ||
"#\n" + | ||
"# Test multi line banner\n" + | ||
"#\n" + | ||
" \n" + | ||
"value: test", | ||
render | ||
); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
cdn-tests/src/test/kotlin/net/dzikoysk/cdn/feature/MultiDescriptionTest.kt
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package net.dzikoysk.cdn.feature | ||
|
||
import net.dzikoysk.cdn.CdnSpec | ||
import net.dzikoysk.cdn.entity.Description | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
import panda.std.ResultAssertions | ||
|
||
internal class MultiDescriptionTest : CdnSpec() { | ||
|
||
internal inner class ConfigurationWithMultiDescription { | ||
|
||
@Description("#") | ||
@Description("# Test multi line banner") | ||
@Description("#") | ||
@Description(" ") | ||
var value = "test" | ||
|
||
} | ||
|
||
@Test | ||
fun `should render multiline banner with empty descriptions`() { | ||
val renderResult = standard.render(ConfigurationWithMultiDescription()) | ||
val render = ResultAssertions.assertOk(renderResult) | ||
|
||
assertEquals(""" | ||
# | ||
# Test multi line banner | ||
# | ||
value: test | ||
""".trimIndent(), render) | ||
} | ||
|
||
} |
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