Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个与硬件串行端口传感器通信的程序。我使用 jssc 作为连接抽象库。
我想创建一个虚拟串口测试类,我可以在没有硬件传感器的情况下测试我的真实生产代码。
如何在单元测试中模拟/伪造/虚拟化串行端口?可以在java中完成吗?
我建议使用Mockito之类的东西来模拟外部库。