Skip to content

Commit 300f927

Browse files
committed
Fix tests after JUnit 5 upgrade
They were not in main.
1 parent 10b2ca3 commit 300f927

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515

1616
package com.rabbitmq.client;
1717

18+
import static org.junit.jupiter.api.Assertions.assertEquals;
19+
import static org.junit.jupiter.api.Assertions.assertFalse;
20+
import static org.junit.jupiter.api.Assertions.assertTrue;
21+
import static org.junit.jupiter.api.Assertions.fail;
22+
1823
import com.rabbitmq.tools.jsonrpc.DefaultJsonRpcMapper;
1924
import com.rabbitmq.tools.jsonrpc.JsonRpcException;
2025
import com.rabbitmq.tools.jsonrpc.JsonRpcMapper;
21-
import org.junit.Test;
2226

2327
import java.lang.reflect.UndeclaredThrowableException;
24-
25-
import static org.junit.Assert.assertEquals;
26-
import static org.junit.Assert.assertFalse;
27-
import static org.junit.Assert.assertTrue;
28-
import static org.junit.Assert.fail;
28+
import org.junit.jupiter.api.Test;
2929

3030
public class DefaultJsonRpcTest extends AbstractJsonRpcTest {
3131

src/test/java/com/rabbitmq/client/test/ChannelNTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ public void serverBasicCancelForUnknownConsumerDoesNotThrowException() throws Ex
5656
channel.processAsync(new AMQCommand(method));
5757
}
5858

59-
@Test(expected = IOException.class)
59+
@Test
6060
public void callingBasicCancelForUnknownConsumerThrowsException() throws Exception {
6161
AMQConnection connection = Mockito.mock(AMQConnection.class);
6262
ChannelN channel = new ChannelN(connection, 1, consumerWorkService);
63-
channel.basicCancel("does-not-exist");
63+
assertThatThrownBy(() -> channel.basicCancel("does-not-exist"))
64+
.isInstanceOf(IOException.class);
6465
}
6566

6667
@Test

src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616

1717
package com.rabbitmq.client.test;
1818

19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.fail;
21+
1922
import com.rabbitmq.tools.json.JSONReader;
2023
import com.rabbitmq.tools.json.JSONWriter;
21-
import org.junit.Test;
22-
23-
import static org.junit.Assert.assertEquals;
24-
import static org.junit.Assert.fail;
24+
import org.junit.jupiter.api.Test;
2525

2626
public class JSONReadWriteTest {
2727

28-
@Test public void readWriteSimple() throws Exception {
28+
@Test
29+
public void readWriteSimple() throws Exception {
2930

3031
Object myRet;
3132
String myJson;

0 commit comments

Comments
 (0)