beatrix: fix deprecated method calls
@@ -60,7 +60,6 @@ import org.killbill.billing.util.callcontext.InternalCallContextFactory;
import org.killbill.billing.util.callcontext.TenantContext;
import org.killbill.billing.util.callcontext.UserType;
import org.killbill.billing.util.tag.DefaultTagDefinition;
-import org.killbill.billing.util.tag.TagDefinition;
import org.killbill.bus.api.BusEvent;
import org.killbill.bus.api.PersistentBus;
import org.killbill.bus.api.PersistentBus.EventBusException;
@@ -71,9 +70,8 @@ import org.testng.annotations.Test;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-import static org.killbill.billing.util.tag.dao.SystemTags.PARK_TAG_DEFINITION_ID;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyObject;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
@@ -705,14 +703,14 @@ public class TestBeatrixListener {
beatrixListener.handleAllInternalKillbillEvents(event);
- verify(externalBus, never()).post(any(BusEvent.class));
+ verify(externalBus, never()).post(isA(BusEvent.class));
}
@Test(groups = "fast")
public void testJsonProcessingException() throws Exception {
InvoicePaymentInfoInternalEvent event = mock(InvoicePaymentInfoInternalEvent.class);
when(event.getBusEventType()).thenReturn(BusInternalEventType.INVOICE_PAYMENT_INFO);
- when(objectMapper.writeValueAsString(anyObject())).thenThrow(JsonProcessingException.class);
+ when(objectMapper.writeValueAsString(any())).thenThrow(JsonProcessingException.class);
// Just make sure exception gets swallowed.
beatrixListener.handleAllInternalKillbillEvents(event);
@@ -725,7 +723,7 @@ public class TestBeatrixListener {
when(event.getBusEventType()).thenReturn(BusInternalEventType.ACCOUNT_CREATE);
when(event.getId()).thenReturn(ACCOUNT_ID);
- doThrow(EventBusException.class).when(externalBus).post(any(BusEvent.class));
+ doThrow(EventBusException.class).when(externalBus).post(isA(BusEvent.class));
beatrixListener.handleAllInternalKillbillEvents(event);
}
