Skip to content

Commit 5d29f2a

Browse files
committed
Update tests
1 parent 7be368b commit 5d29f2a

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/utils/DescriptionsUtilsTest.java

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,22 @@
1010
class DescriptionsUtilsTest {
1111
@Test
1212
void testExtractNotes_singleNote() {
13-
String description = "> NOTE: This is a note.\n> Continued on the next line.";
14-
List<String> notes = DescriptionsUtils.notes( description );
13+
final String description = "> NOTE: This is a note.\n> Continued on the next line.";
14+
final List<String> notes = DescriptionsUtils.notes( description );
1515
assertEquals( 1, notes.size() );
1616
assertEquals( "This is a note.\nContinued on the next line.", notes.get( 0 ) );
1717
}
1818

1919
@Test
2020
void testExtractExamples_multipleExamples() {
21-
String description =
22-
"> EXAMPLE 1: First example.\n> More detail.\n" +
23-
"> EXAMPLE 2: Second example.";
24-
List<String> examples = DescriptionsUtils.examples( description );
21+
final String description =
22+
"""
23+
> EXAMPLE 1: First example.
24+
> More detail.
25+
26+
> EXAMPLE 2: Second example.
27+
""";
28+
final List<String> examples = DescriptionsUtils.examples( description );
2529

2630
assertEquals( 2, examples.size() );
2731
assertEquals( "First example.\nMore detail.", examples.get( 0 ) );
@@ -30,26 +34,29 @@ void testExtractExamples_multipleExamples() {
3034

3135
@Test
3236
void testExtractSources_withLink() {
33-
String description = "> SOURCE: Source with [link](https://example.com)";
34-
List<String> sources = DescriptionsUtils.sources( description );
37+
final String description = "> SOURCE: Source with [link](https://example.com)";
38+
final List<String> sources = DescriptionsUtils.sources( description );
3539
assertEquals( 1, sources.size() );
3640
assertTrue( sources.get( 0 ).contains( "[link](https://example.com)" ) );
3741
}
3842

3943
@Test
4044
void testMixedBlockTypes() {
41-
String description =
42-
"> NOTE: A note block.\n" +
43-
"> EXAMPLE: An example block.\n" +
44-
"> SOURCE: A source block.";
45+
final String description =
46+
"""
47+
> NOTE: A note block.
48+
> EXAMPLE: An example block.
49+
50+
> SOURCE: A source block.
51+
""";
4552
assertEquals( 1, DescriptionsUtils.notes( description ).size() );
4653
assertEquals( 1, DescriptionsUtils.examples( description ).size() );
4754
assertEquals( 1, DescriptionsUtils.sources( description ).size() );
4855
}
4956

5057
@Test
5158
void testNoBlocks() {
52-
String description = "This is a plain description without any special blocks.";
59+
final String description = "This is a plain description without any special blocks.";
5360
assertTrue( DescriptionsUtils.notes( description ).isEmpty() );
5461
assertTrue( DescriptionsUtils.examples( description ).isEmpty() );
5562
assertTrue( DescriptionsUtils.sources( description ).isEmpty() );
@@ -72,8 +79,7 @@ void testToHtml_withAllBlockTypes() {
7279
Some **markdown** content here.
7380
1. Ordered
7481
2. List
75-
"""
76-
;
82+
""";
7783

7884
final String html = DescriptionsUtils.toHtml( description );
7985

0 commit comments

Comments
 (0)