Skip to content

Conversation

Copy link

Copilot AI commented Dec 5, 2025

Addresses review feedback asking for a cleaner approach than extends TestSuite.

Refactored AcceptanceTestSuite to use composition over inheritance:

  • Replaced inheritance with delegation: Internal TestSuite delegate field instead of extending TestSuite
  • Added getTestSuite() accessor: Exposes the delegate for TestSetup and ATServer
  • Simplified AcceptanceTestServerSetUp: Stores AcceptanceTestSuite reference directly, eliminating the (TestSuite) getTest() cast

Before:

public class AcceptanceTestSuite extends TestSuite {
    // ...
    server = new ATServer((TestSuite) getTest(), threaded, ...);
}

After:

public class AcceptanceTestSuite {
    private final TestSuite delegate;
    
    public TestSuite getTestSuite() { return delegate; }
    // ...
    server = new ATServer(acceptanceSuite.getTestSuite(), ...);
}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor JUnit migration to address feedback on TestSuite extension Refactor AcceptanceTestSuite to use composition instead of inheritance Dec 5, 2025
Copilot AI requested a review from chrjohn December 5, 2025 10:20
Copilot finished work on behalf of chrjohn December 5, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants