Update previous patch to use improved version that was merged upstream

Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
This commit is contained in:
Merlin Mathesius 2021-02-04 11:16:54 -06:00
parent 6a43805959
commit c860c5794a
3 changed files with 47 additions and 15 deletions

View File

@ -0,0 +1,40 @@
From 87796e0a6460e8ef22d82ca8e83b14c89ce492e5 Mon Sep 17 00:00:00 2001
From: Merlin Mathesius <mmathesi@redhat.com>
Date: Wed, 3 Feb 2021 09:04:58 -0600
Subject: [PATCH] Make ValueAssertTest less sensitive to AssertJ version
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
---
.../test/java/org/xmlunit/assertj/ValueAssertTest.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
index c3712b7..694af41 100644
--- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
@@ -24,6 +24,7 @@
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
+import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -263,7 +264,13 @@ public void testIsEqualTo_withAttributeValueExpression_shouldPass() {
@Test
public void testIsEqualTo_withAttributeValueExpression_shouldFailed() {
- thrown.expectAssertionError("expected:<\"[something]\"> but was:<\"[abc]\">");
+ thrown.expectAssertionErrorPattern(".*("
+ // AssertJ since "forever"
+ + Pattern.quote("expected:<\"[something]\"> but was:<\"[abc]\">")
+ + "|"
+ // AssertJ 3.19.0+
+ + Pattern.quote("Expecting:\n <\"abc\">\nto be equal to:\n <\"something\">\nbut was not.")
+ + ")");
String xml = "<a><b attr=\"abc\"></b></a>";
--
2.25.1

View File

@ -1,12 +0,0 @@
diff -ru ../xmlunit-2.7.0-src.ORIG/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java ./xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
--- ../xmlunit-2.7.0-src.ORIG/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java 2020-04-28 03:09:04.000000000 -0500
+++ ./xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java 2021-01-29 13:24:38.101158331 -0600
@@ -263,7 +263,7 @@
@Test
public void testIsEqualTo_withAttributeValueExpression_shouldFailed() {
- thrown.expectAssertionError("expected:<\"[something]\"> but was:<\"[abc]\">");
+ thrown.expectAssertionError("Expecting:%n <\"abc\">%nto be equal to:%n <\"something\">%nbut was not.");
String xml = "<a><b attr=\"abc\"></b></a>";

View File

@ -32,7 +32,7 @@ Name: xmlunit
Summary: Provides classes to do asserts on xml Summary: Provides classes to do asserts on xml
Epoch: 0 Epoch: 0
Version: 2.7.0 Version: 2.7.0
Release: 6%{?dist} Release: 7%{?dist}
# xmlunit2 is licensed under ASL 2.0, xmlunit-legacy is still BSD-licensed # xmlunit2 is licensed under ASL 2.0, xmlunit-legacy is still BSD-licensed
License: ASL 2.0 and BSD License: ASL 2.0 and BSD
@ -40,7 +40,8 @@ URL: https://www.xmlunit.org/
Source0: https://github.com/xmlunit/xmlunit/releases/download/v%{version}/%{name}-%{version}-src.tar.gz Source0: https://github.com/xmlunit/xmlunit/releases/download/v%{version}/%{name}-%{version}-src.tar.gz
Patch0: 0001-Disable-tests-requiring-network-access.patch Patch0: 0001-Disable-tests-requiring-network-access.patch
Patch1: xmlunit-2.7.0-ValueAssertTest-fix.patch # From https://github.com/xmlunit/xmlunit/commit/87796e0a6460e8ef22d82ca8e83b14c89ce492e5
Patch1: 0001-Make-ValueAssertTest-less-sensitive-to-AssertJ-versi.patch
BuildArch: noarch BuildArch: noarch
@ -143,8 +144,11 @@ This package provides %{summary}.
%changelog %changelog
* Thu Feb 04 2021 Merlin Mathesius <mmathesi@redhat.com> - 0:2.7.0-7
- Update previous patch to use improved version that was merged upstream
* Fri Jan 29 2021 Merlin Mathesius <mmathesi@redhat.com> - 0:2.7.0-6 * Fri Jan 29 2021 Merlin Mathesius <mmathesi@redhat.com> - 0:2.7.0-6
- Fix FTBFS by patchng ValueAssertTest to adjust for changed format of - Fix FTBFS by patching ValueAssertTest to adjust for changed format of
mismatched string exception mismatched string exception
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.0-5 * Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.0-5