Makes Core and DB assertions coexist with only one import#330
Open
jmaniquet wants to merge 2 commits intoassertj:mainfrom
Open
Makes Core and DB assertions coexist with only one import#330jmaniquet wants to merge 2 commits intoassertj:mainfrom
jmaniquet wants to merge 2 commits intoassertj:mainfrom
Conversation
Member
I had the same line of thinking – let's see if it's feasible. |
Member
|
Thanks @jmaniquet , I'll review it soon. @jmaniquet @scordio I agree with you regarding the depreciation. We will consider it for the next major version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal for : #329
The suggested implementation works nicely in my eyes : I am able to use both core and db assertions while using only one single
org.assertj.core.api.Assertions.assertThatstatic import.Now I did encounter a problem : class
Changes_Constructor_Teststopped compiling with that implementation.The reason is statements like this :
assertThat(changes.getRequestAtStartPoint()).isNull();assertThat(changes.getTablesAtStartPointList()).hasSize(5);The first
assertThatused to return anObjectAssert- which providesisNullassertionThe second used to return a
ListAssert- which provideshasSizeassertionAfter the fix they respectively provide
ChangesAssertandTableAssert, since inputs are now treated as AssertProvider instances.I identified two possible workarounds :
assertThatstatic import with something like this :assertThat((Object) changes.getRequestAtStartPoint()).isNull();assertThatmethods with signatures that suit meI went with second one; but neither maybe acceptable; let me know.
If we go forward with a fix (whatever it may be), I see also this :
BDDAssertions.thenwhich has the same characteristics (I did not notice at first since i do not use it) - AssertJ Core provides itsthenvariants and one has anAssertProvideroverloadassertThatandthenmethods from AssertJ DB seems to become obsolete, and maybe can be deprected; even removed in the future. I could be wrong though.I also added a commit that changes the pom version to a new Snapshot.
I am not sure if I was supposed to do it or not; but I can remove this commit if need be.
Let me know what you think