@@ -212,6 +212,104 @@ def test_init(self, get_connection, test_connection, setup_ssl):
212212 )
213213
214214
215+ class MatillionSSLManagerTest (TestCase ):
216+ """
217+ Tests for Matillion SSL Manager with DPC auth variant (no sslConfig)
218+ """
219+
220+ def test_check_ssl_and_init_dpc_connection_returns_none (self ):
221+ from metadata .generated .schema .entity .services .connections .pipeline .matillionConnection import (
222+ MatillionConnection ,
223+ )
224+ from metadata .utils .ssl_manager import check_ssl_and_init
225+
226+ connection = MatillionConnection (
227+ connection = {
228+ "type" : "MatillionDPC" ,
229+ "clientId" : "test-client" ,
230+ "clientSecret" : "test-secret" ,
231+ "region" : "us1" ,
232+ }
233+ )
234+
235+ result = check_ssl_and_init (connection )
236+
237+ self .assertIsNone (result )
238+
239+ def test_setup_ssl_dpc_connection_returns_connection_unchanged (self ):
240+ from metadata .generated .schema .entity .services .connections .pipeline .matillionConnection import (
241+ MatillionConnection ,
242+ )
243+
244+ connection = MatillionConnection (
245+ connection = {
246+ "type" : "MatillionDPC" ,
247+ "clientId" : "test-client" ,
248+ "clientSecret" : "test-secret" ,
249+ "region" : "us1" ,
250+ }
251+ )
252+
253+ ssl_manager = SSLManager ()
254+ result = ssl_manager .setup_ssl (connection )
255+
256+ self .assertIs (result , connection )
257+
258+ def test_check_ssl_and_init_etl_connection_with_ssl (self ):
259+ from metadata .generated .schema .entity .services .connections .pipeline .matillionConnection import (
260+ MatillionConnection ,
261+ )
262+ from metadata .utils .ssl_manager import check_ssl_and_init
263+
264+ connection = MatillionConnection (
265+ connection = {
266+ "type" : "MatillionETL" ,
267+ "hostPort" : "https://matillion.example.com" ,
268+ "username" : "admin" ,
269+ "password" : "password" ,
270+ "sslConfig" : {"caCertificate" : "caCertificateData" },
271+ }
272+ )
273+
274+ ssl_manager = check_ssl_and_init (connection )
275+
276+ self .assertIsNotNone (ssl_manager )
277+ self .assertIsNotNone (ssl_manager .ca_file_path )
278+
279+ ssl_manager .cleanup_temp_files ()
280+
281+ def test_check_ssl_and_init_etl_connection_without_ssl (self ):
282+ from metadata .generated .schema .entity .services .connections .pipeline .matillionConnection import (
283+ MatillionConnection ,
284+ )
285+ from metadata .utils .ssl_manager import check_ssl_and_init
286+
287+ connection = MatillionConnection (
288+ connection = {
289+ "type" : "MatillionETL" ,
290+ "hostPort" : "https://matillion.example.com" ,
291+ "username" : "admin" ,
292+ "password" : "password" ,
293+ }
294+ )
295+
296+ result = check_ssl_and_init (connection )
297+
298+ self .assertIsNone (result )
299+
300+ def test_check_ssl_and_init_no_connection_returns_none (self ):
301+ from metadata .generated .schema .entity .services .connections .pipeline .matillionConnection import (
302+ MatillionConnection ,
303+ )
304+ from metadata .utils .ssl_manager import check_ssl_and_init
305+
306+ connection = MatillionConnection ()
307+
308+ result = check_ssl_and_init (connection )
309+
310+ self .assertIsNone (result )
311+
312+
215313class MssqlSSLManagerTest (TestCase ):
216314 """
217315 Tests for MSSQL SSL Manager functionality
0 commit comments