@@ -3,6 +3,7 @@ package nl.tudelft.ipv8.messaging.tftp
3
3
import io.mockk.*
4
4
import kotlinx.coroutines.ExperimentalCoroutinesApi
5
5
import kotlinx.coroutines.test.runBlockingTest
6
+ import kotlinx.coroutines.test.runTest
6
7
import nl.tudelft.ipv8.IPv4Address
7
8
import org.apache.commons.net.tftp.TFTP
8
9
import org.apache.commons.net.tftp.TFTPAckPacket
@@ -17,7 +18,7 @@ import java.net.InetAddress
17
18
class TFTPEndpointTest {
18
19
@Suppress(" DEPRECATION" ) // TODO: rewrite usage of coroutines in testing.
19
20
@Test
20
- fun send () = runBlockingTest {
21
+ fun send () = runTest {
21
22
val tftpClient = spyk<TFTPClient >()
22
23
val socket = mockk<DatagramSocket >(relaxed = true )
23
24
val tftpEndpoint = TFTPEndpoint (tftpClient)
@@ -42,7 +43,7 @@ class TFTPEndpointTest {
42
43
43
44
@Suppress(" DEPRECATION" ) // TODO: rewrite usage of coroutines in testing.
44
45
/* @Test */
45
- fun onPacket_forServer () = runBlockingTest {
46
+ fun onPacket_forServer () = runTest {
46
47
val tftpClient = mockk<TFTPClient >(relaxed = true )
47
48
val socket = mockk<DatagramSocket >(relaxed = true )
48
49
val tftpEndpoint = TFTPEndpoint (tftpClient)
@@ -73,7 +74,7 @@ class TFTPEndpointTest {
73
74
74
75
@Suppress(" DEPRECATION" ) // TODO: rewrite usage of coroutines in testing.
75
76
@Test
76
- fun onPacket_forClient () = runBlockingTest {
77
+ fun onPacket_forClient () = runTest {
77
78
val tftpClient = TFTPClient ()
78
79
val socket = mockk<DatagramSocket >(relaxed = true )
79
80
val tftpEndpoint = TFTPEndpoint (tftpClient)
0 commit comments