Tidy up mock creation. (#5627)

* Use our standard XYZMock(.init()) pattern everywhere instead of XYZMock.default.

* Remove the configuration parameter label on mock convenience inits.

* Update the enterprise submodule.
This commit is contained in:
Doug
2026-05-22 17:34:35 +01:00
committed by GitHub
parent edd7130a97
commit 08d02001bf
146 changed files with 540 additions and 546 deletions
@@ -13,37 +13,37 @@ import MatrixRustSDKMocks
extension AuthenticationClientFactoryMock {
struct Configuration {
var homeserverClients = [
"matrix.org": ClientSDKMock(configuration: .init()),
"https://matrix-client.matrix.org": ClientSDKMock(configuration: .init()),
"example.com": ClientSDKMock(configuration: .init(serverAddress: "example.com",
homeserverURL: "https://matrix.example.com",
slidingSyncVersion: .native,
oAuthLoginURL: nil,
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: true)),
"company.com": ClientSDKMock(configuration: .init(serverAddress: "company.com",
homeserverURL: "https://matrix.company.com",
slidingSyncVersion: .native,
oAuthLoginURL: "https://auth.company.com/login",
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: false)),
"server.net": ClientSDKMock(configuration: .init(serverAddress: "server.net",
homeserverURL: "https://matrix.server.net",
slidingSyncVersion: .native,
oAuthLoginURL: nil,
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: false)),
"secure.gov": ClientSDKMock(configuration: .init(serverAddress: "secure.gov",
homeserverURL: "https://ess.secure.gov",
slidingSyncVersion: .native,
oAuthLoginURL: "https://auth.secure.gov/login",
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: false,
elementWellKnown: "{\"version\":1,\"enforce_element_pro\":true}"))
"matrix.org": ClientSDKMock(.init()),
"https://matrix-client.matrix.org": ClientSDKMock(.init()),
"example.com": ClientSDKMock(.init(serverAddress: "example.com",
homeserverURL: "https://matrix.example.com",
slidingSyncVersion: .native,
oAuthLoginURL: nil,
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: true)),
"company.com": ClientSDKMock(.init(serverAddress: "company.com",
homeserverURL: "https://matrix.company.com",
slidingSyncVersion: .native,
oAuthLoginURL: "https://auth.company.com/login",
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: false)),
"server.net": ClientSDKMock(.init(serverAddress: "server.net",
homeserverURL: "https://matrix.server.net",
slidingSyncVersion: .native,
oAuthLoginURL: nil,
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: false)),
"secure.gov": ClientSDKMock(.init(serverAddress: "secure.gov",
homeserverURL: "https://ess.secure.gov",
slidingSyncVersion: .native,
oAuthLoginURL: "https://auth.secure.gov/login",
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: false,
elementWellKnown: "{\"version\":1,\"enforce_element_pro\":true}"))
]
}
convenience init(configuration: Configuration) {
convenience init(_ configuration: Configuration) {
self.init()
makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksClosure = { address, _, _, _, _, _ in