diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index be48c6b8..bf57c730 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -13,6 +13,10 @@ For a detailed view of what has changed, refer to the {url-repo}/commits/main[co == Unreleased +Improvement:: + +* Upgrade to asciidoctorj 2.0.18 (#1126) + == 2.5.6 (2022-09-19) Improvement:: diff --git a/asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionGroupIsRegistered.java b/asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionGroupIsRegistered.java index cadb6806..87898d0d 100644 --- a/asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionGroupIsRegistered.java +++ b/asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionGroupIsRegistered.java @@ -46,10 +46,11 @@ import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.startsWith; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @RunWith(Arquillian.class) @@ -111,8 +112,6 @@ private StringBuilder readContent(String target) { bufferedReader.close(); - } catch (MalformedURLException e) { - throw new IllegalArgumentException(e); } catch (IOException e) { throw new IllegalArgumentException(e); } @@ -180,8 +179,6 @@ private StringBuilder readContent(String target) { bufferedReader.close(); - } catch (MalformedURLException e) { - throw new IllegalArgumentException(e); } catch (IOException e) { throw new IllegalArgumentException(e); } @@ -242,7 +239,7 @@ public void a_docinfoprocessor_should_be_executed_and_add_meta_in_footer() { Element footer = doc.getElementById("footer"); // Since Asciidoctor 1.5.3 the docinfo in the footer is a sibling to the footer element - assertTrue("robots".equals(footer.nextElementSibling().attr("name"))); + assertEquals("robots", footer.nextElementSibling().attr("name")); } @Test @@ -436,7 +433,7 @@ public void a_include_processor_should_only_handle_its_handles() { org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8"); - Element contentElement = doc.getElementsByAttributeValue("class", "bare").first(); + Element contentElement = doc.getElementsByClass("bare").first(); assertThat(contentElement.text(), startsWith("sample-book.adoc")); diff --git a/asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionIsRegistered.java b/asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionIsRegistered.java index b121dc19..7cd18bd1 100644 --- a/asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionIsRegistered.java +++ b/asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionIsRegistered.java @@ -47,12 +47,12 @@ import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.startsWith; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; @RunWith(Arquillian.class) public class WhenJavaExtensionIsRegistered { @@ -239,7 +239,7 @@ public void a_docinfoprocessor_should_be_executed_and_add_meta_in_footer() { Element footer = doc.getElementById("footer"); // Since Asciidoctor 1.5.3 the docinfo in the footer is a sibling to the footer element - assertTrue("robots".equals(footer.nextElementSibling().attr("name"))); + assertEquals("robots", footer.nextElementSibling().attr("name")); } @Test @@ -429,11 +429,11 @@ public void a_include_processor_should_only_handle_its_handles() { javaExtensionRegistry.includeProcessor(UriIncludeProcessor.class); String content = asciidoctor.convertFile(classpath.getResource("sample-with-include.ad"), - options().toFile(false).get()); + Options.builder().toFile(false).build()); org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8"); - Element contentElement = doc.getElementsByAttributeValue("class", "bare").first(); + Element contentElement = doc.getElementsByClass("bare").first(); assertThat(contentElement.text(), startsWith("sample-book.adoc")); diff --git a/build.gradle b/build.gradle index 61e9ed78..f9455eaa 100644 --- a/build.gradle +++ b/build.gradle @@ -79,8 +79,8 @@ ext { pdfboxVersion = '1.8.16' // gem versions - asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '2.0.17' - asciimathGemVersion = '2.0.3' + asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '2.0.18' + asciimathGemVersion = '2.0.4' coderayGemVersion = '1.1.3' rougeGemVersion = '3.30.0'