samdjstevens / java-totp

A java library for implementing Time-based One Time Passwords for Multi-Factor Authentication.
MIT License
448 stars 109 forks source link

Fix #19 DataUriEncodingTest.testDataUriEncode fails on Java 11 #20

Closed OlivierJaquemet closed 4 years ago

OlivierJaquemet commented 4 years ago

When reading/write an image, the behavior may (will!) different from one Java version to another.

No longer use any image API in this test. Rational : The purpose of the method Utils.getDataUriForImage being tested is not to read or write an image by following some image format specification. But simply to ensure that a specified byte array (representing an image) gets written using the Data URI specification in base64.

Rewrite the test just to check that :

samdjstevens commented 4 years ago

Awesome, thanks a lot for the fix! Agree the test is much better now.