From 757a65fe95f5f203545085ea63f659a817dad260 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 12 Feb 2021 08:03:49 -0500 Subject: Fix sonars from dependency upgrade The dependency upgrades in policy-parent caused some new sonars. In particular, initMocks() has been deprecated - replaced with calls to the Mockito Runner. Changed one to openMocks() because using the Runner caused it to fail on jenkins, but not in the local eclipse. Also fixed a type safety issue with EMPTY_LIST. Issue-ID: POLICY-2909 Change-Id: Iea9420190f208d7de3bf3ad531515c92e0fab83f Signed-off-by: Jim Hahn --- .../onap/policy/drools/simulators/DMaaPSimulatorJaxRsTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'feature-simulators') diff --git a/feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRsTest.java b/feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRsTest.java index b1275004..6e1a8d68 100644 --- a/feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRsTest.java +++ b/feature-simulators/src/test/java/org/onap/policy/drools/simulators/DMaaPSimulatorJaxRsTest.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. @@ -36,9 +36,11 @@ import javax.servlet.http.HttpServletResponse; import org.junit.After; 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 DMaaPSimulatorJaxRsTest { private static final String MESSAGE = "hello"; private static final String MESSAGE2 = "world"; @@ -57,8 +59,6 @@ public class DMaaPSimulatorJaxRsTest { */ @Before public void setUp() { - MockitoAnnotations.initMocks(this); - sim = new DMaaPSimulatorJaxRs(); } -- cgit 1.2.3-korg