Closed rodrigo-rassystem closed 1 year ago
I think this was already addressed in Issue #512 (with the fix to be included in the upcoming release). Just to verify, please try the following snapshot and see if it works for you:
SNAPSHOT Version: 2.10.4-SNAPSHOT SNAPSHOT Direct Download Link SNAPSHOT Instructions
Version 2.10.4-SNAPSHOT worked. Thank you.
Fixed with v2.10.4 release
Hello, we are using JSerialComm in our project and we have some JUnit tests that use a "mock" from SerialPort, like this:
Until version 2.9.3 this mock works well, but in version 2.10.3 it stopped working due to an error. The relevant part of the error is:
We tried to remove mockito from this test but it is impossible to create an instance of SerialPort since it´s constructor is private.
We don´t want to stop testing, but with Android dependencies in the JAR it is not possible anymore.
I can think in some possible solutions: 1) release a JSErialComm.jar version without Android dependencies. 2) refactor the code to make SerialPort an interface so it will be easier to mock. 3) create a static method to make a "mocked" SerialPort for people that want to write unit tests.
Following the trace error: