From a57710faad56015eb3b69a5ce6f8da235ca146c7 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 11 Feb 2021 16:13:32 -0500 Subject: Fix sonars from depeendency upgrade The dependency upgrades in policy-parent caused some new sonars. In particular, initMocks() has been deprecated - replaced with calls to the Mockito Runner. Issue-ID: POLICY-2914 Change-Id: Iaf10f676c380adb9785e836cb15792596b378e4e Signed-off-by: Jim Hahn --- .../onap/policy/common/utils/time/PseudoScheduledFutureTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'utils-test/src') diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/time/PseudoScheduledFutureTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/time/PseudoScheduledFutureTest.java index e23bbd29..248edf61 100644 --- a/utils-test/src/test/java/org/onap/policy/common/utils/time/PseudoScheduledFutureTest.java +++ b/utils-test/src/test/java/org/onap/policy/common/utils/time/PseudoScheduledFutureTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,9 +31,11 @@ import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; +@RunWith(MockitoJUnitRunner.class) public class PseudoScheduledFutureTest { private static final long DELAY_MS = 1000L; @@ -49,8 +51,6 @@ public class PseudoScheduledFutureTest { */ @Before public void setUp() { - MockitoAnnotations.initMocks(this); - when(work.getDelay()).thenReturn(DELAY_MS); count = 0; -- cgit 1.2.3-korg