connection updates

This commit is contained in:
Mark Gregory
2026-10-19 12:47:16 +01:00
parent 682132e7ac
commit a27680d893
-22
View File
@@ -52,28 +52,6 @@ final class DBSynTests: XCTestCase {
XCTAssertEqual(decoded, profile)
}
func testLegacyConnectionProfileDefaultsTLSAndSSH() throws {
let legacy = """
{"id":"00000000-0000-0000-0000-000000000001","name":"Legacy","host":"127.0.0.1","port":3306,"username":"root","database":""}
"""
let profile = try JSONDecoder().decode(ConnectionProfile.self, from: Data(legacy.utf8))
XCTAssertTrue(profile.useTLS)
XCTAssertFalse(profile.useSSHTunnel)
XCTAssertEqual(profile.sshPort, 22)
}
func testConnectionProfileRetainsSecurityPreferences() throws {
var profile = ConnectionProfile()
profile.useTLS = false
profile.useSSHTunnel = true
profile.sshHost = "gateway.example.test"
profile.sshPort = 2222
let decoded = try JSONDecoder().decode(ConnectionProfile.self, from: JSONEncoder().encode(profile))
XCTAssertEqual(decoded, profile)
XCTAssertFalse(decoded.useTLS)
XCTAssertTrue(decoded.useSSHTunnel)
}
func testIntrospectionCacheCodableRoundTrip() throws {
let connectionID = UUID()
let column = DatabaseModel.IntrospectedColumn(table: "ADCUSERS", name: "id", dataType: "bigint", nullable: false, key: "PRI", defaultValue: nil, extra: "auto_increment")