From aa82ed33a2e8c178fcd2a2106f57023d6947d84e Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Wed, 13 Dec 2023 06:57:39 +0100 Subject: [PATCH] Update dependencies (#26) * Update dependencies Changes: * parent POM to 16 * remove sole use of hamcrest * jmh update * nullcheck --- pom.xml | 14 ++++---------- .../plexus/util/xml/pull/MXParserTest.java | 16 ++++++++-------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 32cff2a..f554aeb 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.codehaus.plexus plexus - 13 + 16 plexus-xml @@ -55,7 +55,7 @@ limitations under the License. org.apache.maven maven-xml-impl - 4.0.0-alpha-7 + 4.0.0-alpha-8 org.eclipse.sisu @@ -66,13 +66,13 @@ limitations under the License. org.openjdk.jmh jmh-core - 1.36 + 1.37 test org.openjdk.jmh jmh-generator-annprocess - 1.36 + 1.37 test @@ -80,12 +80,6 @@ limitations under the License. junit-jupiter test - - org.hamcrest - hamcrest - 2.2 - test - org.codehaus.plexus plexus-utils diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java b/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java index f7c9d68..0359b8c 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java @@ -33,8 +33,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import static org.hamcrest.MatcherAssert.*; -import static org.hamcrest.Matchers.*; import static org.junit.jupiter.api.Assertions.*; /** @@ -1485,14 +1483,16 @@ void testBlankAtBeginning(String ws) throws XmlPullParserException, IOException MXParser parser = new MXParser(); parser.setInput(new StringReader(ws + xml)); - assertThat( - assertThrows(XmlPullParserException.class, parser::next).getMessage(), - containsString("XMLDecl is only allowed as first characters in input")); + + String message; + message = assertThrows(XmlPullParserException.class, parser::next).getMessage(); + assertNotNull(message); + assertTrue(message.contains("XMLDecl is only allowed as first characters in input"), message); parser.setInput(new StringReader(ws + xml)); assertEquals(XmlPullParser.IGNORABLE_WHITESPACE, parser.nextToken()); - assertThat( - assertThrows(XmlPullParserException.class, parser::nextToken).getMessage(), - containsString("processing instruction can not have PITarget with reserved xml name")); + message = assertThrows(XmlPullParserException.class, parser::nextToken).getMessage(); + assertNotNull(message); + assertTrue(message.contains("processing instruction can not have PITarget with reserved xml name"), message); } }