Description
None of the UI classes have any test coverage. While UI testing is complex, at least the CLI command logic and input validation could be tested.
Missing Tests
No tests for:
JNexus.java (CLI with 3 commands: list, delete, stats)
JNexusSwing.java (1446 lines, no tests)
JNexusAWT.java (no tests)
JNexusUI.java (Terminal UI, no tests)
Current Coverage
✓ Core business logic (NexusService, NexusClient) - well tested
✓ Data models (ComponentMetadata, SearchCriteria, etc.) - tested
✗ UI layer - 0% coverage
Testable Components
CLI (JNexus.java):
- Command parsing and validation
- Error handling for invalid inputs
- Output formatting
- Date parsing logic (currently generic catch blocks)
Swing/AWT/Terminal:
- Input validation
- Button/action handlers (can mock service calls)
- Error display logic
Recommended Approach
For CLI:
@Test
void testListCommand_withInvalidDate_showsHelpfulError() {
String[] args = {"list", "repo", "--created-after", "invalid"};
int exitCode = new CommandLine(new JNexus()).execute(args);
assertEquals(1, exitCode);
// Verify error message mentions ISO 8601 format
}
For Swing/AWT:
- Use headless mode:
System.setProperty("java.awt.headless", "true")
- Mock NexusService to test logic without real HTTP
- Test error dialogs, input validation
Impact
Description
None of the UI classes have any test coverage. While UI testing is complex, at least the CLI command logic and input validation could be tested.
Missing Tests
No tests for:
JNexus.java(CLI with 3 commands: list, delete, stats)JNexusSwing.java(1446 lines, no tests)JNexusAWT.java(no tests)JNexusUI.java(Terminal UI, no tests)Current Coverage
✓ Core business logic (NexusService, NexusClient) - well tested
✓ Data models (ComponentMetadata, SearchCriteria, etc.) - tested
✗ UI layer - 0% coverage
Testable Components
CLI (JNexus.java):
Swing/AWT/Terminal:
Recommended Approach
For CLI:
For Swing/AWT:
System.setProperty("java.awt.headless", "true")Impact