I had problems in some flow with unicode chars in some of my flows. So i fixed the flow and added a test.
assertEquals("Björk", buyingOption.getArtist());
the buyingOption.getArtist() will return the same name that is on ,here is a snippet :

but junit will fail with the message :
junit.framework.ComparisonFailure: null
Expected :Bj?rk
Actual :Bj?rk
at com.delver.update.system.AECSystemTest.basicOperationtsTest1(AECSystemTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
This is probably due to the default encoding used for your Java source files. The ö in the string literal in the JUnit source code is probably being converted to something else when the test is compiled.
To avoid this, use Unicode escapes (\uxxxx) in the string literals in your JUnit source code:
assertEquals("Bj\u00F6rk", buyingOption.getArtist());
I agree with Grodriguez but would like to suggest you to change your default encoding to UTF-8 and forget about this kind of problems.
How to do this? It depends on your IDE. For example in Eclipse go to Window/Preferences then type "encoding", choose Workspace and change encoding to UTf-8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With