Conversation
ascopes
force-pushed
the
feature/GH-2647-stack-trace-assertions-base
branch
from
June 25, 2022 15:59
843dc2f to
6522b39
Compare
ascopes
force-pushed
the
feature/GH-2647-stack-trace-assertions-base
branch
2 times, most recently
from
June 29, 2022 09:53
f33734c to
7a15cd4
Compare
|
…afely
This updates the signature of three proxy-returning methods for the
assumptions conduit which enables the proxy implementations to
consume array types safely, which is needed for the next commit.
This should not be a breaking API change as the only public signature
that has changed is now less restrictive than it was previously.
Public API changes:
- SoftAssertionsProvider#proxy signature is now less
restrictive, having changed from
(Class<SELF> a, Class<ACTUAL> b, ACTUAL c)
to
(Class<SELF> a, Class<? extends ACTUAL> b, ACTUAL c).
This allows passing array types in for parameter `b`
correctly without unnecesarry casts.
Internal changes:
- Assumptions#asAssumption signature changed from
(Class<ASSERTION> a, Class<ACTUAL> b, Object c)
to
(Class<ASSERTION> a, Class<? extends ACTUAL> b, ACTUAL c).
This allows converting instances where b is an array
type correctly. This also makes this class more typesafe, which
will simplify maintainability in the future. An explicit cast
is needed to prevent the internal arguments being ambiguous
in intent within varargs expansion.
- SoftProxies#createSoftAssertionProxy signature changed from
(Class<SELF> a, Class<ACTUAL> b, ACTUAL c)
to
(Class<SELF> a, Class<? extends ACTUAL> b, ACTUAL c).
This allows passing in an array type for parameter `b`, which
previously would not compile.
(e.g. (..., StackTraceElement[].class, ex.getStackTrace());
This introduces the skeleton for two new types of assertion/assumption: - assertThat(StackTraceElement) - to perform assertions upon StackTraceElement types. - assertThat(StackTraceElement[]) - to perform assertions upon StackTraceElement[] types. Due to the new signature conflicting with one of the existing test suites, I have implemented a temporary workaround to prevent having to totally reimplement that class, since the new API is not yet usable in this set of changes. I will remove this in the second PR that implements the actual functionality. I have also made one of the proxy methods in the API less restrictive to allow it to work with passing array types around.
ascopes
force-pushed
the
feature/GH-2647-stack-trace-assertions-base
branch
from
July 16, 2022 12:40
b91db6b to
c3fe8ca
Compare
|
scordio
force-pushed
the
main
branch
2 times, most recently
from
July 20, 2023 15:20
38c7b4b to
3cde5bf
Compare
Contributor
Author
|
hey, is there any update on this? |
Member
|
@ascopes nope, sorry, a bit too busy on our side. We'll plan this one for the next release (either 4.0 or 2.26.0) Could you rebase on main to solve the conflicts. |
scordio
force-pushed
the
3.x
branch
2 times, most recently
from
June 1, 2024 16:04
301ca01 to
c730d18
Compare
This branch has not been deployed
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.
First PR for GH-2647 to implement assertions for
StackTraceElementandStackTraceElement[]types.