diff options
author | 2024-09-03 11:23:13 +0100 | |
---|---|---|
committer | 2024-09-03 11:26:29 +0100 | |
commit | 8984516c6d1ffaf21627a1d5e6b452895f37823a (patch) | |
tree | c247acfee33c94a437f1a181108a55dba1f3f175 /main | |
parent | 36f3d678dd7a0403bad1487ab706a947d763c689 (diff) |
Fix small sonar issues
Issue-ID: POLICY-5068
Change-Id: I2f58c2e8ef510ebdd48cb90b713eb95822ff1fb8
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'main')
6 files changed, 10 insertions, 8 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java index 865ad7a8..8bafdd2e 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation. + * Modifications Copyright (C) 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,7 @@ class PdpRequestsTest extends CommonRequestBase { /** * Sets up. */ + @Override @BeforeEach public void setUp() { update = makeUpdateReq(PDP1, MY_GROUP, MY_SUBGROUP); diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java index 4eeeae1d..4e83ef0e 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java @@ -4,7 +4,7 @@ * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. - * Modifications Copyright (C) 2022-2023 Nordix Foundation. + * Modifications Copyright (C) 2022-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -102,6 +102,7 @@ public class PublisherTest extends Threaded { * * @throws Exception if an error occurs */ + @Override @BeforeEach public void setUp() throws Exception { super.setUp(); @@ -117,6 +118,7 @@ public class PublisherTest extends Threaded { * * @throws Exception if an error occurs */ + @Override @AfterEach public void tearDown() throws Exception { TopicEndpointManager.getManager().getNoopTopicSink(PDP_PAP_TOPIC).unregister(listener); diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/TimerManagerTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/TimerManagerTest.java index 67f3d363..94aa4da5 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/TimerManagerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/TimerManagerTest.java @@ -31,7 +31,6 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.onap.policy.pap.main.comm.TimerManager.Timer; diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/StateChangeReqTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/StateChangeReqTest.java index 1ec23356..76e86126 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/StateChangeReqTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/StateChangeReqTest.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation. + * Modifications Copyright (C) 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ class StateChangeReqTest extends CommonRequestBase { * * @throws Exception if an error occurs */ + @Override @BeforeEach public void setUp() throws Exception { super.setUp(); diff --git a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java index 8196dd73..3b99ab03 100644 --- a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java @@ -30,7 +30,6 @@ import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; import jakarta.ws.rs.core.Response.Status; diff --git a/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java b/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java index 04eacd50..032f44db 100644 --- a/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2022 Bell Canada. All rights reserved. - * Modifications Copyright (C) 2022-2023 Nordix Foundation. + * Modifications Copyright (C) 2022-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,7 +120,7 @@ class ToscaServiceTemplateServiceTest { } @Test - void testGetPolicyList() throws PfModelException { + void testGetPolicyList() { assertThatThrownBy(() -> toscaService.getPolicyList(NAME, VERSION)) .isInstanceOf(PfModelRuntimeException.class).hasRootCauseMessage(INVALID_VERSION_ERR_MSG); @@ -134,7 +134,7 @@ class ToscaServiceTemplateServiceTest { } @Test - void testPolicyForMetadataSet() throws PfModelException { + void testPolicyForMetadataSet() { List<ToscaPolicy> policies = toscaService.getPolicyList("onap.restart.tca", VERSION_1); assertThat(policies.get(0).getMetadata()).containsEntry("metadataSet", nodeTemplate.getMetadata()); |