|
33 | 33 | server/1, |
34 | 34 | resource/1]). |
35 | 35 |
|
| 36 | +%% Override |
| 37 | +-export([start_connection_default/4]). |
| 38 | + |
36 | 39 | -import(escalus_compat, [bin/1, unimplemented/0]). |
37 | 40 |
|
38 | 41 | -define(WAIT_FOR_STANZA_TIMEOUT, 1000). |
|
47 | 50 | start(Config, UserSpec, Resource) -> |
48 | 51 | EventClient = escalus_event:new_client(Config, UserSpec, Resource), |
49 | 52 | Options = escalus_users:get_options(Config, UserSpec, Resource, EventClient), |
50 | | - case escalus_connection:start(Options) of |
| 53 | + case start_connection(Config, UserSpec, Resource, Options) of |
51 | 54 | {ok, Conn, Props, _} -> |
52 | 55 | Jid = make_jid(Props), |
53 | 56 | Client = #client{jid = Jid, conn = Conn, event_client = EventClient}, |
@@ -149,3 +152,11 @@ make_jid(Proplist) -> |
149 | 152 | {server, S} = lists:keyfind(server, 1, Proplist), |
150 | 153 | {resource, R} = lists:keyfind(resource, 1, Proplist), |
151 | 154 | <<U/binary,"@",S/binary,"/",R/binary>>. |
| 155 | + |
| 156 | +start_connection(Config, UserSpec, Resource, Options) -> |
| 157 | + escalus_overridables:do(Config, start_connection, |
| 158 | + [Config, UserSpec, Resource, Options], |
| 159 | + {?MODULE, start_connection_default}). |
| 160 | + |
| 161 | +start_connection_default(_Config, _UserSpec, _Resource, Options) -> |
| 162 | + escalus_connection:start(Options). |
0 commit comments