cryostat-legacy icon indicating copy to clipboard operation
cryostat-legacy copied to clipboard

Network-accessing classes need to be testable

Open andrewazores opened this issue 5 years ago • 2 comments

Currently there are several classes which create TCP sockets or HTTP client connections (some examples: RecordingExporter, UploadSavedRecordingsCommand, SocketClientReaderWriter, SocketInteractiveShellExecutor, JMCConnection), and which are partly or entirely missing unit tests since the networking codepaths can not be exercised in unit testing without actually producing network connections. We need some enhanced mocking utilities, or a test harness to intercept connections, in order to properly test and verify these classes.

andrewazores avatar Jun 26 '19 13:06 andrewazores

JMCConnection has been moved to https://github.com/rh-jmc-team/container-jfr-core

andrewazores avatar Jul 22 '19 15:07 andrewazores

This is improved since #23 since fewer classes directly establish connections, but NetworkResolver, RecordingExporter, and SocketClientReaderWriter need testing. Particularly the latter two as they are larger and relatively complex.

andrewazores avatar Aug 07 '19 20:08 andrewazores