From ec348b97648f1e927365d17d376495bbd2b39c67 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 11 Feb 2021 17:06:38 -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, in most cases. Changed to openMocks() in one case and removed unnecessary stubbings. Issue-ID: POLICY-2905 Change-Id: I9aa098aa7aaebba09f6dcea4cac69ac1e5fbd4d6 Signed-off-by: Jim Hahn --- .../policy/models/sim/dmaap/provider/DmaapSimProviderTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'models-sim/models-sim-dmaap/src/test') diff --git a/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProviderTest.java b/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProviderTest.java index 6c79ce9f8..3d72f2e4c 100644 --- a/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProviderTest.java +++ b/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProviderTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2020 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. @@ -44,15 +44,17 @@ import javax.ws.rs.core.Response.Status; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.coder.StandardCoderObject; import org.onap.policy.models.sim.dmaap.parameters.DmaapSimParameterGroup; +@RunWith(MockitoJUnitRunner.class) public class DmaapSimProviderTest { private static final String EXPECTED_EXCEPTION = "expected exception"; private static final long SWEEP_SEC = 10L; @@ -86,8 +88,6 @@ public class DmaapSimProviderTest { */ @Before public void setUp() { - MockitoAnnotations.initMocks(this); - when(params.getTopicSweepSec()).thenReturn(SWEEP_SEC); prov = new MyProvider(params); -- cgit 1.2.3-korg