Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isValidAgainst doesn't override custom message #225

Closed
Wolf05632 opened this issue Aug 13, 2021 · 7 comments
Closed

isValidAgainst doesn't override custom message #225

Wolf05632 opened this issue Aug 13, 2021 · 7 comments
Labels
Milestone

Comments

@Wolf05632
Copy link

isValidAgainst method in assertj3.XmlAssert module doesn't override custom error message:

XmlAssert
.assertThat(xmlSource)
.withFailMessage("Alarm alarm!")
.isValidAgainst(xsdSource);

expected:

java.lang.AssertionError: Alarm alarm!
Expecting: ...

fact:

java.lang.AssertionError:
Expecting: ...
@bodewig bodewig added this to the 2.8.3 milestone Aug 19, 2021
@bodewig
Copy link
Member

bodewig commented Aug 19, 2021

I must admit that I'm nowhere close to being an AssertJ expert, so if you know how to fix it, I'd be grateful for a PR. If I need to figure things out, it is gong to take a bit longer, I'm afraid.

krystiankaluzny added a commit to krystiankaluzny/xmlunit that referenced this issue Aug 28, 2021
krystiankaluzny added a commit to krystiankaluzny/xmlunit that referenced this issue Aug 28, 2021
krystiankaluzny added a commit to krystiankaluzny/xmlunit that referenced this issue Aug 28, 2021
@bodewig
Copy link
Member

bodewig commented Aug 29, 2021

OK, it took quite a bit more effort than I thought it would take, but I think it all assertions now honor overridden error messages.

@bodewig bodewig closed this as completed Aug 29, 2021
@bodewig
Copy link
Member

bodewig commented Aug 29, 2021

Sorry, @krystiankaluzny I didn't see you started working on it as well. Maybe we can merge your changes with mine in any way?

@bodewig bodewig reopened this Aug 29, 2021
@krystiankaluzny
Copy link
Member

Hi @bodewig I didn't notice that here are notifications about my commits :)
I don't see a problem to merge our changes. I will try soon to apply my changes to the current main branch

@bodewig
Copy link
Member

bodewig commented Sep 2, 2021

@krystiankaluzny I only saw the notifications here when I came back to comment on the issue :-)

I agree it should be possible to merge your approach of extracting the configuration and inheriting the info property with my changes - I liked your approach better than mine. Actually I've not been happy with duplicating the code that copied the info properties to three places myself.

For the assetj3 module I toyed with the idea of getting rid of our own allSatisfy method in MultipleNodeAssert in favor of the built-in one, but this would result in the assertion error messages changing (we'd lose the custom navigationDescription) so I backed off.

bodewig added a commit that referenced this issue Oct 3, 2021
@bodewig
Copy link
Member

bodewig commented Oct 3, 2021

@krystiankaluzny I think I've merged our two branches to main over here by now

Boiarshinov pushed a commit to Boiarshinov/xmlunit that referenced this issue Oct 4, 2021
@bodewig bodewig closed this as completed Oct 17, 2021
@bodewig
Copy link
Member

bodewig commented Oct 17, 2021

XMLUnit for Java 2.8.3 has just been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants