* ONAP PAP
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2024-2025 OpenInfra Foundation Europe. 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.
import java.util.Set;
import java.util.stream.Collectors;
import lombok.Getter;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.Strings;
import org.onap.policy.models.pdp.concepts.PdpMessage;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
PdpUpdate message = getMessage();
- if (!StringUtils.equals(message.getPdpGroup(), response.getPdpGroup())) {
+ if (!Strings.CS.equals(message.getPdpGroup(), response.getPdpGroup())) {
return "group does not match";
}
- if (!StringUtils.equals(message.getPdpSubgroup(), response.getPdpSubgroup())) {
+ if (!Strings.CS.equals(message.getPdpSubgroup(), response.getPdpSubgroup())) {
return "subgroup does not match";
}
protected final boolean isSameContent(PdpUpdate second) {
PdpUpdate first = getMessage();
- if (!StringUtils.equals(first.getPdpGroup(), second.getPdpGroup())) {
+ if (!Strings.CS.equals(first.getPdpGroup(), second.getPdpGroup())) {
return false;
}
- if (!StringUtils.equals(first.getPdpSubgroup(), second.getPdpSubgroup())) {
+ if (!Strings.CS.equals(first.getPdpSubgroup(), second.getPdpSubgroup())) {
return false;
}
* ONAP
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. 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.
class PdpStatusMessageHandlerTest {
@BeforeAll
- public static void setupClass() {
+ static void setupClass() {
Registry.newRegistry();
}
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2022-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2022-2025 OpenInfra Foundation Europe. 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.
import org.onap.policy.pap.main.parameters.CommonTestData;
import org.onap.policy.pap.main.parameters.PapParameterGroup;
-public class PublisherTest extends Threaded {
+class PublisherTest extends Threaded {
// these messages will have different request IDs
private static final PdpStateChange MSG1 = new PdpStateChange();
* Configures the topic and attaches a listener.
*/
@BeforeAll
- public static void setUpBeforeClass() {
+ static void setUpBeforeClass() {
final PapParameterGroup parameterGroup = new CommonTestData().getPapParameterGroup(6969);
TopicEndpointManager.getManager().shutdown();
}
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
TopicEndpointManager.getManager().shutdown();
}
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. 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.
import org.onap.policy.pap.main.notification.StatusAction.Action;
import org.onap.policy.pap.main.service.PolicyStatusService;
-public class DeploymentStatusTest {
+class DeploymentStatusTest {
private static final String VERSION = "1.2.3";
private static final @NonNull String GROUP_A = "groupA";
* Set up the meter registry for tests.
*/
@BeforeAll
- public static void setUpBeforeClass() {
+ static void setUpBeforeClass() {
Registry.registerOrReplace(PapConstants.REG_METER_REGISTRY, new SimpleMeterRegistry());
}
* Tear down the meter registry after tests.
*/
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
Registry.unregister(PapConstants.REG_METER_REGISTRY);
}
* Sets up.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
autoCloseable = MockitoAnnotations.openMocks(this);
tracker = new DeploymentStatus(policyStatusService);
* ONAP
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. 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.
* Sets up test objects.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
tracker = new DeploymentTracker();
builder = PdpPolicyStatus.builder().deploy(true).state(State.SUCCESS).pdpGroup(MY_GROUP).pdpType(MY_PDP_TYPE)
.policy(POLICY_A).policyType(POLICY_TYPE).pdpId(PDP_A);
* ONAP PAP
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* Creates various objects, including {@link #notifier}.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
closeable = MockitoAnnotations.openMocks(this);
lenient().when(policyStatusService.getGroupPolicyStatus(anyString())).thenReturn(Collections.emptyList());
Registry.registerOrReplace(PapConstants.REG_METER_REGISTRY, new SimpleMeterRegistry());
* ================================================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. 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.
*/
@BeforeEach
@SuppressWarnings("unchecked")
- public void setUp() {
+ void setUp() {
pub = mock(Publisher.class);
disp = mock(RequestIdDispatcher.class);
lock = new Object();
* ONAP PAP
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. 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.
*/
@BeforeEach
@SuppressWarnings("unchecked")
- public void setUp() {
+ void setUp() {
pub = mock(Publisher.class);
disp = mock(RequestIdDispatcher.class);
lock = new Object();
* ONAP PAP
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023, 2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
private BodyBuilder bldr;
@BeforeEach
- public void setUp() {
+ void setUp() {
bldr = ResponseEntity.ok();
closeable = MockitoAnnotations.openMocks(this);
}
@AfterEach
- public void after() throws Exception {
+ void after() throws Exception {
closeable.close();
}
* ONAP PAP
* ================================================================================
* Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2022-2023 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* Configures DAO, captors, and various mocks.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
Registry.newRegistry();
}
@AfterEach
- public void tearDown() throws Exception {
+ void tearDown() throws Exception {
closeable.close();
}
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022-2023 Nordix Foundation.
+ * Copyright (C) 2022-2023, 2025 OpenInfra Foundation Europe. 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.
@AutoConfigureObservability
@ContextConfiguration
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
-public class TestActuatorEndpoints {
+class TestActuatorEndpoints {
@Autowired
private WebApplicationContext context;
.httpBasic("policyAdmin", "zb!XztG34");
@BeforeAll
- public static void setupClass() {
+ static void setupClass() {
Registry.newRegistry();
}
* ONAP PAP
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. 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.
* Sets up.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
oldGroup = new PdpGroup();
oldGroup.setName(NAME);
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2019, 2022-2024 Nordix Foundation.
+ * Copyright (C) 2019, 2022-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2019 AT&T Intellectual Property.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.report.HealthCheckReport;
import org.onap.policy.models.base.PfModelRuntimeException;
-import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.bean.override.mockito.MockitoBean;
/**
* Class to perform unit test of {@link HealthCheckRestControllerV1}.
private static final String HEALTHCHECK_ENDPOINT = "healthcheck";
- @MockBean
+ @MockitoBean
private PolicyStatusProvider policyStatusProvider;
@Test
* ============LICENSE_START=======================================================
* ONAP PAP
* ================================================================================
- * Copyright (C) 2019-2021, 2023-2024 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2021 AT&T Intellectual Property.
* Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
* ================================================================================
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.pap.main.PapConstants;
-public class TestPdpGroupCreateOrUpdateProvider extends ProviderSuper {
+class TestPdpGroupCreateOrUpdateProvider extends ProviderSuper {
private static final String EXPECTED_EXCEPTION = "expected exception";
private static final String PDP2 = "pdpB";
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
Registry.newRegistry();
}
* ONAP PAP
* ================================================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2020-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
import org.onap.policy.pap.main.rest.ProviderBase.Updater;
-public class TestPdpGroupDeleteProvider extends ProviderSuper {
+class TestPdpGroupDeleteProvider extends ProviderSuper {
private static final String EXPECTED_EXCEPTION = "expected exception";
private static final String GROUP1_NAME = "groupA";
private Updater updater;
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
Registry.newRegistry();
}
* ONAP PAP
* ================================================================================
* Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
-public class TestPdpGroupDeployProvider extends ProviderSuper {
+class TestPdpGroupDeployProvider extends ProviderSuper {
private static final String EXPECTED_EXCEPTION = "expected exception";
private static final String POLICY2_NAME = "policyB";
private PdpGroupDeployProvider prov;
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
Registry.newRegistry();
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019, 2023-2024 Nordix Foundation.
+ * Copyright (C) 2019, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Configures DAO and mocks.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
autoCloseable = MockitoAnnotations.openMocks(this);
Registry.newRegistry();
groups = loadFile().getGroups();
}
@AfterEach
- public void tearDown() throws Exception {
+ void tearDown() throws Exception {
autoCloseable.close();
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import org.onap.policy.models.pap.concepts.PolicyAudit.AuditAction;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
-public class TestPolicyAuditManager extends ProviderSuper {
+class TestPolicyAuditManager extends ProviderSuper {
private static final ToscaConceptIdentifier MY_POLICY = new ToscaConceptIdentifier("myPolicy", "1.0.0");
private static final String GROUP_A = "pdpGroup-A";
}
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
Registry.newRegistry();
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020, 2022-2024 Nordix Foundation.
+ * Copyright (C) 2020, 2022-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2020-2021 AT&T Corp.
* Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
* ================================================================================
* @throws Exception if an error occurs
*/
@BeforeEach
- public void setUp() throws Exception {
+ void setUp() throws Exception {
autoCloseable = MockitoAnnotations.openMocks(this);
groups = loadPdpGroupsFromFile().getGroups();
when(pdpGroupService.getPdpGroups()).thenReturn(groups);
* Tear down.
*/
@AfterEach
- public void tearDown() throws Exception {
+ void tearDown() throws Exception {
if (savedPapParameterGroup != null) {
ParameterService.register(savedPapParameterGroup, true);
} else {
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. 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.
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
-public class TestPolicyStatusProvider extends ProviderSuper {
+class TestPolicyStatusProvider extends ProviderSuper {
private static final String MY_GROUP = "MyGroup";
private static final String MY_PDP_TYPE = "MySubGroup";
private static final @NonNull String POLICY_TYPE_VERSION = "1.0.3";
private PolicyStatusProvider prov;
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
Registry.newRegistry();
}
/**
* Configures mocks and objects.
- *
*/
@Override
@BeforeEach
* ONAP PAP
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. 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.
import org.onap.policy.models.pdp.concepts.PdpSubGroup;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
-public class TestPolicyUndeployerImpl extends ProviderSuper {
+class TestPolicyUndeployerImpl extends ProviderSuper {
private static final String MY_GROUP = "my-group";
private static final String MY_SUBGROUP = "my-subgroup";
private static final String MY_SUBGROUP0 = "my-subgroup-0";
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
Registry.newRegistry();
}
* ONAP PAP
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import org.onap.policy.pap.main.PapConstants;
import org.springframework.test.util.ReflectionTestUtils;
-public class TestProviderBase extends ProviderSuper {
+class TestProviderBase extends ProviderSuper {
private static final String EXPECTED_EXCEPTION = "expected exception";
private static final String POLICY1_NAME = "policyA";
private MyProvider prov;
@AfterAll
- public static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
Registry.newRegistry();
}
* ============LICENSE_START=======================================================
* ONAP PAP
* ================================================================================
- * Copyright (C) 2022-2023 Nordix Foundation. All rights reserved.
+ * Copyright (C) 2022-2023, 2025 OpenInfra Foundation Europe. 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.
* Set up for tests.
*/
@BeforeEach
- public void setup() throws CoderException {
+ void setup() throws CoderException {
autoCloseable = MockitoAnnotations.openMocks(this);
coder.decode(ResourceUtils.getResourceAsString("e2e/policyMetadataSet.yaml"),
ToscaServiceTemplate.class).getToscaTopologyTemplate().getNodeTemplates()
}
@AfterEach
- public void tearDown() throws Exception {
+ void tearDown() throws Exception {
autoCloseable.close();
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2022 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2022-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2022-2025 OpenInfra Foundation Europe. 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.
* @throws CoderException the exception
*/
@BeforeEach
- public void setup() throws CoderException {
+ void setup() throws CoderException {
autoCloseable = MockitoAnnotations.openMocks(this);
coder.decode(ResourceUtils.getResourceAsString("e2e/policyMetadataSet.yaml"),
ToscaServiceTemplate.class).getToscaTopologyTemplate().getNodeTemplates()
}
@AfterEach
- public void tearDown() throws Exception {
+ void tearDown() throws Exception {
autoCloseable.close();
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019, 2022-2024 Nordix Foundation.
+ * Copyright (C) 2019, 2022-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property.
* Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved.
* ================================================================================
*
* @author Ram Krishna Verma (ram.krishna.verma@est.tech)
*/
-public class TestPapActivator {
+class TestPapActivator {
private static final String CONFIG_FILE = "src/test/resources/parameters/TestConfigParams.json";
private PapActivator activator;
* Allocates a new DB name, server port, and creates a config file.
*/
@BeforeAll
- public static void setUpBeforeClass() {
+ static void setUpBeforeClass() {
Registry.newRegistry();
CommonTestData.newDb();
}
* @throws Exception if an error occurs
*/
@BeforeEach
- public void setUp() throws Exception {
+ void setUp() throws Exception {
Registry.newRegistry();
TopicEndpointManager.getManager().shutdown();
HttpServletServerFactoryInstance.getServerFactory().destroy();
* @throws Exception if an error occurs
*/
@AfterEach
- public void teardown() throws Exception {
+ void teardown() throws Exception {
if (activator != null && activator.isAlive()) {
activator.stop();
}
}
@AfterAll
- public static void afterClass() {
+ static void afterClass() {
Registry.newRegistry();
}