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

ObjectAppendingMarker in v7.0+ has no means to access the fieldValue as its object type #719

Closed
timorjim opened this issue Dec 20, 2021 · 3 comments · Fixed by #720
Closed

Comments

@timorjim
Copy link

Describe the bug
Have a test using AssertJ that accesses the field in ObjectAppendingMarker. It previously was called object and the test could access it as the correct object type. v7.0 renamed the field to be fieldValue and the AssertJ reflection favours the getFieldValue method over the field itself, and the getter always returns a string.

Is there a way to get the fieldValue as its type rather than a string? I have a value that is a map, and having this converted to a string makes testing problematic.

@brenuart
Copy link
Collaborator

brenuart commented Dec 20, 2021

Hmmm... that's weird :-(

After some investigations there is no actual reasons why ObjectAppendingMarker#getFieldValue() must return a "string" version of the "fieldValue". This method is (currently) only used by SingleFieldAppendingMarker#toStringSelf() that already takes care of converting into a String.

We could simply change that method and make it return the value of the fieldValue field without transformation. This should help you with your test case.

In addition, this method should ideally be made protected as well...

brenuart added a commit that referenced this issue Dec 20, 2021
…rming it into a String

`ObjectAppendingMarker#getFieldValue()` should ideally return the value of the `fieldValue` property without transformation. This method is intended to be used by `SingleFieldAppendingMarker#tselfToString()` that already takes care of converting the value into a String.

closes #719
@brenuart
Copy link
Collaborator

@tim: is the proposed PR ok for you ?

@brenuart brenuart added the status/waiting-for-feedback Waiting for feedback from the original author. Issue will be closed if feedback is not received soon label Dec 21, 2021
@timorjim
Copy link
Author

@brenuart that sounds good to me. Appreciate the quick response! Thanks

@brenuart brenuart removed the status/waiting-for-feedback Waiting for feedback from the original author. Issue will be closed if feedback is not received soon label Dec 21, 2021
brenuart added a commit that referenced this issue Jan 5, 2022
…rming it into a String (#720)

`ObjectAppendingMarker#getFieldValue()` should ideally return the value of the `fieldValue` property without transformation. This method is intended to be used by `SingleFieldAppendingMarker#tselfToString()` that already takes care of converting the value into a String.

closes #719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants