mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-02-18 03:12:57 -08:00
Move address into transport config
This makes it possible to use a factory function to create a transport of the right type and not having to repeat the address when calling Transport.Connect()
This commit is contained in:
committed by
Mickaël Rémond
parent
f8d0e99696
commit
7fa4b06705
@@ -25,7 +25,13 @@ func TestClient_Connect(t *testing.T) {
|
||||
mock.Start(t, testXMPPAddress, handlerConnectSuccess)
|
||||
|
||||
// Test / Check result
|
||||
config := Config{Address: testXMPPAddress, Jid: "test@localhost", Credential: Password("test"), Insecure: true}
|
||||
config := Config{
|
||||
TransportConfiguration: TransportConfiguration{
|
||||
Address: testXMPPAddress,
|
||||
},
|
||||
Jid: "test@localhost",
|
||||
Credential: Password("test"),
|
||||
Insecure: true}
|
||||
|
||||
var client *Client
|
||||
var err error
|
||||
@@ -47,7 +53,13 @@ func TestClient_NoInsecure(t *testing.T) {
|
||||
mock.Start(t, testXMPPAddress, handlerAbortTLS)
|
||||
|
||||
// Test / Check result
|
||||
config := Config{Address: testXMPPAddress, Jid: "test@localhost", Credential: Password("test")}
|
||||
config := Config{
|
||||
TransportConfiguration: TransportConfiguration{
|
||||
Address: testXMPPAddress,
|
||||
},
|
||||
Jid: "test@localhost",
|
||||
Credential: Password("test"),
|
||||
}
|
||||
|
||||
var client *Client
|
||||
var err error
|
||||
@@ -71,7 +83,13 @@ func TestClient_FeaturesTracking(t *testing.T) {
|
||||
mock.Start(t, testXMPPAddress, handlerAbortTLS)
|
||||
|
||||
// Test / Check result
|
||||
config := Config{Address: testXMPPAddress, Jid: "test@localhost", Credential: Password("test")}
|
||||
config := Config{
|
||||
TransportConfiguration: TransportConfiguration{
|
||||
Address: testXMPPAddress,
|
||||
},
|
||||
Jid: "test@localhost",
|
||||
Credential: Password("test"),
|
||||
}
|
||||
|
||||
var client *Client
|
||||
var err error
|
||||
@@ -94,7 +112,14 @@ func TestClient_RFC3921Session(t *testing.T) {
|
||||
mock.Start(t, testXMPPAddress, handlerConnectWithSession)
|
||||
|
||||
// Test / Check result
|
||||
config := Config{Address: testXMPPAddress, Jid: "test@localhost", Credential: Password("test"), Insecure: true}
|
||||
config := Config{
|
||||
TransportConfiguration: TransportConfiguration{
|
||||
Address: testXMPPAddress,
|
||||
},
|
||||
Jid: "test@localhost",
|
||||
Credential: Password("test"),
|
||||
Insecure: true,
|
||||
}
|
||||
|
||||
var client *Client
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user