Skip to content

Commit 7865c10

Browse files
committed
Fix Mockito test on Java 13
1 parent 08d7af3 commit 7865c10

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
<jackson.version>2.9.8</jackson.version>
6161
<logback.version>1.2.3</logback.version>
6262
<junit.version>4.12</junit.version>
63-
<awaitility.version>3.1.0</awaitility.version>
64-
<mockito.version>2.21.0</mockito.version>
63+
<awaitility.version>3.1.5</awaitility.version>
64+
<mockito.version>2.23.4</mockito.version>
6565

6666
<maven.javadoc.plugin.version>3.0.1</maven.javadoc.plugin.version>
6767
<maven.release.plugin.version>2.5.3</maven.release.plugin.version>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class ConnectionTest {
3939
@Parameterized.Parameter
4040
public TestConfigurator configurator;
4141
@Mock
42-
Connection c = mock(Connection.class);
42+
MyConnection c = mock(MyConnection.class);
4343
@Mock
4444
Channel ch = mock(Channel.class);
4545

@@ -124,4 +124,9 @@ public Optional<Channel> open(Connection c) throws IOException {
124124
}
125125
}
126126

127+
// trick to make Mockito call the optional method defined in the interface
128+
static abstract class MyConnection implements Connection {
129+
130+
}
131+
127132
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
status = error
2+
dest = err
3+
name = PropertiesConfig
4+
5+
appender.console.type = Console
6+
appender.console.name = STDOUT
7+
appender.console.layout.type = PatternLayout
8+
appender.console.layout.pattern = %m%n
9+
10+
logger.com.rabbitmq.level = info
11+
rootLogger.level = error
12+
rootLogger.appenderRef.stdout.ref = STDOUT

0 commit comments

Comments
 (0)