Skip to content

Commit

Permalink
Remove deprecated Mockito api use (apache#13329)
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhangjian authored Dec 16, 2021
1 parent acb7aa1 commit d7eea00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.pulsar.common.util.netty;

import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;

import io.netty.channel.Channel;
import io.netty.channel.DefaultChannelPromise;
Expand All @@ -30,6 +29,7 @@
import java.util.concurrent.TimeUnit;

import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeMethod;
Expand Down Expand Up @@ -62,7 +62,7 @@ public void shutdownEventLoop() throws InterruptedException {

@BeforeMethod
public void setup() {
initMocks(this);
MockitoAnnotations.openMocks(this);
when(channel.eventLoop()).thenReturn(eventLoop);

channelFuture = new DefaultChannelPromise(channel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class WebSocketWebResourceTest {

@BeforeMethod
public void setup(Method method) throws Exception {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);

ServiceConfiguration config = new ServiceConfiguration();
config.setSuperUserRoles(Sets.newHashSet(SUPER_USER));
Expand Down

0 comments on commit d7eea00

Please sign in to comment.