2323import org .asciidoctor .OptionsBuilder ;
2424import org .asciidoctor .SafeMode ;
2525import org .assertj .core .api .SoftAssertions ;
26+ import org .assertj .core .api .junit .jupiter .InjectSoftAssertions ;
2627import org .assertj .core .api .junit .jupiter .SoftAssertionsExtension ;
2728import org .junit .jupiter .api .BeforeEach ;
2829import org .junit .jupiter .api .Test ;
2930import org .junit .jupiter .api .extension .ExtendWith ;
3031import org .junit .jupiter .api .io .TempDir ;
32+ import org .junit .jupiter .params .ParameterizedTest ;
33+ import org .junit .jupiter .params .provider .ValueSource ;
3134
3235import java .io .File ;
3336import java .net .URISyntaxException ;
@@ -48,6 +51,9 @@ class ProcedureSyntaxAutoCheckerTest {
4851
4952 private static final String newLine = System .lineSeparator ();
5053
54+ @ InjectSoftAssertions
55+ private SoftAssertions softAssertions ;
56+
5157 @ BeforeEach
5258 void setUp () {
5359 // By default we are forced to use relative path which we don't want.
@@ -57,18 +63,19 @@ void setUp() {
5763
5864 }
5965
60- @ Test
61- void correctSyntaxSectionTest (SoftAssertions softAssertions ) throws URISyntaxException {
66+ @ ParameterizedTest (name = "{0}" )
67+ @ ValueSource (strings = {"include-with-syntax.adoc" , "include-with-syntax-parameter-with-link.adoc" })
68+ void correctSyntaxSectionTest (String positiveResource ) throws URISyntaxException {
6269 try (var asciidoctor = createAsciidoctor (softAssertions )) {
63- var file = Paths .get (getClass ().getClassLoader ().getResource ("include-with-syntax.adoc" ).toURI ()).toFile ();
70+ var file = Paths .get (getClass ().getClassLoader ().getResource (positiveResource ).toURI ()).toFile ();
6471 assertTrue (file .exists () && file .canRead ());
6572
6673 asciidoctor .convertFile (file , options );
6774 }
6875 }
6976
7077 @ Test
71- void shouldFailOnMissingResultsTable (SoftAssertions softAssertions ) throws URISyntaxException {
78+ void shouldFailOnMissingResultsTable () throws URISyntaxException {
7279 try (var asciidoctor = createAsciidoctor (softAssertions )) {
7380 var file = Paths
7481 .get (getClass ()
@@ -85,7 +92,7 @@ void shouldFailOnMissingResultsTable(SoftAssertions softAssertions) throws URISy
8592 }
8693
8794 @ Test
88- void shouldFailOnMoreThanOneResultsTable (SoftAssertions softAssertions ) throws URISyntaxException {
95+ void shouldFailOnMoreThanOneResultsTable () throws URISyntaxException {
8996 try (var asciidoctor = createAsciidoctor (softAssertions )) {
9097 var file = Paths
9198 .get (getClass ()
@@ -102,7 +109,7 @@ void shouldFailOnMoreThanOneResultsTable(SoftAssertions softAssertions) throws U
102109 }
103110
104111 @ Test
105- void shouldFailOnMissingCodeBlock (SoftAssertions softAssertions ) throws URISyntaxException {
112+ void shouldFailOnMissingCodeBlock () throws URISyntaxException {
106113 try (var asciidoctor = createAsciidoctor (softAssertions )) {
107114 var file = Paths
108115 .get (getClass ().getClassLoader ().getResource ("invalid-include-with-syntax-no-code-block.adoc" ).toURI ())
@@ -116,7 +123,7 @@ void shouldFailOnMissingCodeBlock(SoftAssertions softAssertions) throws URISynta
116123 }
117124
118125 @ Test
119- void shouldFailOnMoreThanOneCodeBlock (SoftAssertions softAssertions ) throws URISyntaxException {
126+ void shouldFailOnMoreThanOneCodeBlock () throws URISyntaxException {
120127 try (var asciidoctor = createAsciidoctor (softAssertions )) {
121128 var file = Paths
122129 .get (getClass ()
0 commit comments