28
28
import org .junit .jupiter .params .ParameterizedTest ;
29
29
import org .junit .jupiter .params .provider .EnumSource ;
30
30
31
- class AspectModelDocumentationGeneratorTest {
31
+ public class AspectModelDocumentationGeneratorTest {
32
32
@ ParameterizedTest
33
33
@ EnumSource ( value = TestAspect .class )
34
- void testGeneration ( final TestAspect testAspect ) {
34
+ public void testGeneration ( final TestAspect testAspect ) {
35
35
assertThatCode ( () -> {
36
36
final String html = generateHtmlDocumentation ( testAspect );
37
37
assertThat ( html ).doesNotContain ( "UnnamedCharacteristic" );
@@ -41,7 +41,7 @@ void testGeneration( final TestAspect testAspect ) {
41
41
}
42
42
43
43
@ Test
44
- void testAspectWithEntityCollection () throws Throwable {
44
+ public void testAspectWithEntityCollection () throws Throwable {
45
45
final String htmlResult = generateHtmlDocumentation ( TestAspect .ASPECT_WITH_ENTITY_COLLECTION );
46
46
47
47
assertThat ( htmlResult ).isNotEmpty ();
@@ -53,7 +53,7 @@ void testAspectWithEntityCollection() throws Throwable {
53
53
}
54
54
55
55
@ Test
56
- void testAspectWithCollectionOfSimpleType () throws Throwable {
56
+ public void testAspectWithCollectionOfSimpleType () throws Throwable {
57
57
final String htmlResult = generateHtmlDocumentation ( TestAspect .ASPECT_WITH_COLLECTION_OF_SIMPLE_TYPE );
58
58
59
59
assertThat ( htmlResult ).isNotEmpty ();
@@ -65,14 +65,14 @@ void testAspectWithCollectionOfSimpleType() throws Throwable {
65
65
}
66
66
67
67
@ Test
68
- void testScriptTagIsEscaped () throws IOException {
68
+ public void testScriptTagIsEscaped () throws IOException {
69
69
assertThat ( generateHtmlDocumentation ( TestAspect .ASPECT_WITH_SCRIPT_TAGS ) )
70
70
.isNotEmpty ()
71
71
.doesNotContain ( "<script>alert('Should not be alerted');</script>" );
72
72
}
73
73
74
74
@ Test
75
- void testRubyGemUpdateCommandIsNotExecuted () throws IOException {
75
+ public void testRubyGemUpdateCommandIsNotExecuted () throws IOException {
76
76
try ( final ByteArrayOutputStream stdOut = new ByteArrayOutputStream () ) {
77
77
System .setOut ( new PrintStream ( stdOut ) );
78
78
generateHtmlDocumentation ( TestAspect .ASPECT_WITH_RUBY_GEM_UPDATE_COMMAND );
@@ -81,7 +81,7 @@ void testRubyGemUpdateCommandIsNotExecuted() throws IOException {
81
81
}
82
82
83
83
@ Test
84
- void testHtmlTagsAreEscaped () throws IOException {
84
+ public void testHtmlTagsAreEscaped () throws IOException {
85
85
assertThat ( generateHtmlDocumentation ( TestAspect .ASPECT_WITH_HTML_TAGS ) )
86
86
.isNotEmpty ()
87
87
.doesNotContain ( "<img src=xss.png onerror=alert('Boom!')>" )
@@ -90,20 +90,20 @@ void testHtmlTagsAreEscaped() throws IOException {
90
90
}
91
91
92
92
@ Test
93
- void testEncodedTextIsNotDecoded () throws IOException {
93
+ public void testEncodedTextIsNotDecoded () throws IOException {
94
94
assertThat ( generateHtmlDocumentation ( TestAspect .ASPECT_WITH_ENCODED_STRINGS ) )
95
95
.doesNotContain ( "This is an Aspect with encoded text." )
96
96
.contains ( "VGhpcyBpcyBhbiBBc3BlY3Qgd2l0aCBlbmNvZGVkIHRleHQu" );
97
97
}
98
98
99
99
@ Test
100
- void testAspectModelUrnIsDisplayed () throws IOException {
100
+ public void testAspectModelUrnIsDisplayed () throws IOException {
101
101
assertThat ( generateHtmlDocumentation ( TestAspect .ASPECT_WITH_HTML_TAGS ) )
102
102
.contains ( "urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithHtmlTags" );
103
103
}
104
104
105
105
@ Test
106
- void testDocInfosAreDisplayed () throws IOException {
106
+ public void testDocInfosAreDisplayed () throws IOException {
107
107
assertThat ( generateHtmlDocumentation ( TestAspect .ASPECT_WITH_HTML_TAGS ) )
108
108
.contains ( ".toc-list" )
109
109
.contains ( "aspect-model-diagram" )
@@ -115,13 +115,13 @@ void testDocInfosAreDisplayed() throws IOException {
115
115
}
116
116
117
117
@ Test
118
- void testDocumentationIsNotEmptyForModelWithoutLanguageTags () throws IOException {
118
+ public void testDocumentationIsNotEmptyForModelWithoutLanguageTags () throws IOException {
119
119
final String aspectWithoutLanguageTags = generateHtmlDocumentation ( TestAspect .ASPECT_WITHOUT_LANGUAGE_TAGS );
120
120
assertThat ( aspectWithoutLanguageTags ).isNotEmpty ();
121
121
}
122
122
123
123
@ Test
124
- void testAspectWithAbstractSingleEntityExpectSuccess () throws IOException {
124
+ public void testAspectWithAbstractSingleEntityExpectSuccess () throws IOException {
125
125
final String documentation = generateHtmlDocumentation ( TestAspect .ASPECT_WITH_ABSTRACT_SINGLE_ENTITY );
126
126
assertThat ( documentation ).contains (
127
127
"<h3 id=\" org-eclipse-esmf-test-AspectWithAbstractSingleEntity-org-eclipse-esmf-test-testProperty-property\" >testProperty</h3"
@@ -134,7 +134,7 @@ void testAspectWithAbstractSingleEntityExpectSuccess() throws IOException {
134
134
}
135
135
136
136
@ Test
137
- void testAspectWithAbstractEntityExpectSuccess () throws IOException {
137
+ public void testAspectWithAbstractEntityExpectSuccess () throws IOException {
138
138
final String documentation = generateHtmlDocumentation ( TestAspect .ASPECT_WITH_ABSTRACT_ENTITY );
139
139
assertThat ( documentation ).contains (
140
140
"<h3 id=\" org-eclipse-esmf-test-AspectWithAbstractEntity-org-eclipse-esmf-test-testProperty-property\" >Test Property</h3>" );
@@ -146,7 +146,7 @@ void testAspectWithAbstractEntityExpectSuccess() throws IOException {
146
146
}
147
147
148
148
@ Test
149
- void testAspectWithCollectionWithAbstractEntityExpectSuccess () throws IOException {
149
+ public void testAspectWithCollectionWithAbstractEntityExpectSuccess () throws IOException {
150
150
final String documentation = generateHtmlDocumentation ( TestAspect .ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY );
151
151
assertThat ( documentation ).contains (
152
152
"<h3 id=\" org-eclipse-esmf-test-AspectWithCollectionWithAbstractEntity-org-eclipse-esmf-test-testProperty-property"
@@ -159,7 +159,7 @@ void testAspectWithCollectionWithAbstractEntityExpectSuccess() throws IOExceptio
159
159
}
160
160
161
161
@ Test
162
- void testAspectWithQuantifiableWithoutUnit () throws IOException {
162
+ public void testAspectWithQuantifiableWithoutUnit () throws IOException {
163
163
try ( final ByteArrayOutputStream stdOut = new ByteArrayOutputStream () ) {
164
164
System .setOut ( new PrintStream ( stdOut ) );
165
165
assertThatCode ( () -> generateHtmlDocumentation ( TestAspect .ASPECT_WITH_QUANTIFIABLE_WITHOUT_UNIT ) )
@@ -168,7 +168,7 @@ void testAspectWithQuantifiableWithoutUnit() throws IOException {
168
168
}
169
169
170
170
@ Test
171
- void testAspectWithConstraintWithSeeAttribute () throws IOException {
171
+ public void testAspectWithConstraintWithSeeAttribute () throws IOException {
172
172
final String documentation = generateHtmlDocumentation ( TestAspect .ASPECT_WITH_CONSTRAINT_WITH_SEE_ATTRIBUTE );
173
173
assertThat ( documentation ).contains (
174
174
"<h3 id=\" org-eclipse-esmf-test-AspectWithConstraintWithSeeAttribute-org-eclipse-esmf-test-testPropertyTwo-property"
0 commit comments