Merge "Add a method to help mocking registerNetworkAgent" into main