cryostatio / cryostat-legacy

OUTDATED - See the new repository below! -- Secure JDK Flight Recorder management for containerized JVMs
https://github.com/cryostatio/cryostat
Other
224 stars 31 forks source link

Network-accessing classes need to be testable #6

Open andrewazores opened 5 years ago

andrewazores commented 5 years ago

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 commented 5 years ago

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

andrewazores commented 5 years ago

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.