gzhao9 opened a new pull request, #8137: URL: https://github.com/apache/cloudstack/pull/8137
### Description This PR addresses a problem similar to the one mentioned in Issue #8087 by adopting the same solution approach used in PR #8098. Specifically, it refactors the mock object creation for `NetworkVO` across test suites of four classes: `InstanceIpModelTest.java`, `VirtualMachineModelTest.java`, `VirtualNetworkModelTest.java`, and the `testCreateVMInterface` method in another class. The central concern is the repetitive mock object creations for `NetworkVO`. #### Proposed Changes Following the methodology from PR #8098, I've introduced a new and reusable `MockNetworkVO` class. This class is designated for creating `NetworkVO` mock objects with consistent behavior, aiming to eliminate redundancy. #### Benefits of the Proposed Refactoring: - **This refactoring leads to a cleaner codebase, streamlining the test cases and enhancing maintainability.** - **Should there arise a need to modify the `NetworkVO` mock creation process in the future, adjustments will only be necessary within the `MockNetworkVO` class. This centralizes modifications instead of scattering them across multiple test classes.** <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged --> **Fixes: Similar Issue to #8087** -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
