package Ġio . call stats . interceptor Ċ Ċ import Ġio . call stats . On Ice Connection Change Ċ import Ġio . call stats . event . ice . Ice Abort ed Event Ċ import Ġio . call stats . event . ice . Ice Connection Dis rupt End Event Ċ import Ġio . call stats . event . ice . Ice Connection Dis rupt Start Event Ċ import Ġio . call stats . event . ice . Ice Dis rupt End Event Ċ import Ġio . call stats . event . ice . Ice Dis rupt Start Event Ċ import Ġio . call stats . event . ice . Ice Failed Event Ċ import Ġio . call stats . event . ice . Ice Restart Event Ċ import Ġio . call stats . event . ice . Ice Terminated Event Ċ import Ġorg . junit . Assert . assertTrue Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito Annotations Ċ import Ġorg . webrtc . Peer Connection Ċ import Ġorg . webrtc . Peer Connection . Ice Connection State Ċ import Ġorg . webrtc . RTC Stats Ċ Ċ class ĠI ce Interceptor Test Ġ{ ĊĠĠĊĠ Ġ@ Mock Ġprivate Ġlateinit Ġvar Ġconnection : ĠPeer Connection ĊĊĠ Ġprivate Ġlateinit Ġvar Ġinterceptor : ĠI ce Interceptor ĊĠ Ġprivate Ġlateinit Ġvar Ġstats : ĠMap < String , ĠRTC Stats > ĊĊĠ Ġ@ Before ĊĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĠĠĠ Ġstats Ġ= Ġmap Of ( ĊĠĠĠĠĠĠĠ Ġ" local " Ġto ĠRTC Stats ( 0 , Ġ" local - candidate ", Ġ" id 1 ", Ġmap Of ()), ĊĠĠĠĠĠĠĠ Ġ" remote " Ġto ĠRTC Stats ( 0 , Ġ" remote - candidate ", Ġ" id 2 ", Ġmap Of ()), ĊĠĠĠĠĠĠĠ Ġ" pair " Ġto ĠRTC Stats ( 0 , Ġ" candidate - pair ", Ġ" id 3 ", Ġmap Of ())) ĊĠĠĠ Ġinterceptor Ġ= ĠI ce Interceptor () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġice Dis ruption Start () Ġ{ ĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events . any Ġ{ Ġit Ġis ĠI ce Dis rupt Start Event Ġ}) ĊĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . COMPLETED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents 2 Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events 2 . any Ġ{ Ġit Ġis ĠI ce Dis rupt Start Event Ġ}) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġice Dis ruption End () Ġ{ ĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events . any Ġ{ Ġit Ġis ĠI ce Dis rupt End Event Ġ}) ĊĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents 2 Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . COMPLETED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events 2 . any Ġ{ Ġit Ġis ĠI ce Dis rupt End Event Ġ}) ĊĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents 3 Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CHECK ING ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events 3 . any Ġ{ Ġit Ġis ĠI ce Dis rupt End Event Ġ}) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġice Restart () Ġ{ ĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . COMPLETED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . NEW ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events . any Ġ{ Ġit Ġis ĠI ce Restart Event Ġ}) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġice Failed () Ġ{ ĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CHECK ING ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . FAILED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events . any Ġ{ Ġit Ġis ĠI ce Failed Event Ġ}) ĊĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents 2 Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . FAILED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events 2 . any Ġ{ Ġit Ġis ĠI ce Failed Event Ġ}) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġice Abort () Ġ{ ĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CHECK ING ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CLOSED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events . any Ġ{ Ġit Ġis ĠI ce Abort ed Event Ġ}) ĊĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . NEW ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents 2 Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CLOSED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events 2 . any Ġ{ Ġit Ġis ĠI ce Abort ed Event Ġ}) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġice Terminated () Ġ{ ĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CLOSED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events . any Ġ{ Ġit Ġis ĠI ce Terminated Event Ġ}) ĊĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . COMPLETED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents 2 Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CLOSED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events 2 . any Ġ{ Ġit Ġis ĠI ce Terminated Event Ġ}) ĊĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . FAILED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents 3 Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CLOSED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events 3 . any Ġ{ Ġit Ġis ĠI ce Terminated Event Ġ}) ĊĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents 4 Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CLOSED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events 4 . any Ġ{ Ġit Ġis ĠI ce Terminated Event Ġ}) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġice Connection Dis ruption Start () Ġ{ ĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CHECK ING ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events . any Ġ{ Ġit Ġis ĠI ce Connection Dis rupt Start Event Ġ}) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġice Connection Dis ruption End () Ġ{ ĊĠĠĠ Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . DIS CONNECTED ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ Ġval Ġevents Ġ= Ġinterceptor . process ( connection , ĠOn Ice Connection Change ( Ice Connection State . CHECK ING ), Ġ" local 1 ", Ġ" remote 1 ", Ġ" con 1 ", Ġstats ) ĊĠĠĠ ĠassertTrue ( events . any Ġ{ Ġit Ġis ĠI ce Connection Dis rupt End Event Ġ}) ĊĠ Ġ} Ċ }