You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do I need to augment my code to make this work or is this an actual bug in shazamcrest / GSON / moneta? From the shazamcrest doc it looks like it should work with any class.
Problem looks similar to #14 in that this type needs custom serialized (ignoring after serialization is not viable here). Money.monetaryContext is being serialized, which contains a Class<?> typed field, which GSON doesn't like.
Mainainers, what do you think about adding a type adapter for Class that calls getName()/fromClass?
Other options is to add the ability to add Custom Type to the GSON Instance.
Allowing the person to modify how certain objects render to add the readablitiy of test output!
@roloreaper I think that's out of the question because the fact that it uses GSON is an implementation detail, though it could be hidden behind a nice wrapper API to be able to customize things.
When trying to compare 2 objects containing an instance of org.javamoney.moneta.Money shazamcrest / GSON will throw
The stack trace beginning just after the test class: shazamcrestStackTrace.txt
Do I need to augment my code to make this work or is this an actual bug in shazamcrest / GSON / moneta? From the shazamcrest doc it looks like it should work with any class.
Minimal code to reproduce:
assertThat(Money.of(42, "EUR"), sameBeanAs(Money.of(42, "EUR")));
Many thanks in advance for your help.
Christian
The text was updated successfully, but these errors were encountered: