diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-09-12 15:27:38 +0100 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-09-13 12:47:16 +0100 |
commit | 281cd97df5d674d2a4168a80e2e0a21b7c21e076 (patch) | |
tree | b486144fa5e56e75bdbabbad0fbb23cdd0ceed2d /controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/utils/ControlLoopUtilsTest.java | |
parent | b2d624d4655fa4b4e0cebbf7e41dc96b38fa0df5 (diff) |
Upgrade drools-applications to JUnit 5java-17
Issue-ID: POLICY-4819
Change-Id: I33e1f156a1ea0e98cb6386a7d10d06be4dc258d9
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/utils/ControlLoopUtilsTest.java')
-rw-r--r-- | controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/utils/ControlLoopUtilsTest.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/utils/ControlLoopUtilsTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/utils/ControlLoopUtilsTest.java index 9e29af511..55e980337 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/utils/ControlLoopUtilsTest.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/utils/ControlLoopUtilsTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,28 +21,28 @@ package org.onap.policy.controlloop.utils; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.resources.ResourceUtils; import org.onap.policy.controlloop.drl.legacy.ControlLoopParams; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; -public class ControlLoopUtilsTest { +class ControlLoopUtilsTest { @Test - public void testToControlLoopParams() throws Exception { - String policyJson = + void testToControlLoopParams() throws Exception { + var policyJson = ResourceUtils.getResourceAsString("policies/vCPE.policy.operational.input.tosca.json"); - ToscaServiceTemplate serviceTemplate = new StandardCoder().decode(policyJson, ToscaServiceTemplate.class); - ToscaPolicy toscaPolicy = + var serviceTemplate = new StandardCoder().decode(policyJson, ToscaServiceTemplate.class); + var toscaPolicy = serviceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get("operational.restart"); - ControlLoopParams params = ControlLoopUtils.toControlLoopParams(toscaPolicy); + var params = ControlLoopUtils.toControlLoopParams(toscaPolicy); assertEquals("ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", params.getClosedLoopControlName()); assertEquals(toscaPolicy.getName(), params.getPolicyName()); assertEquals(toscaPolicy.getVersion(), params.getPolicyVersion()); |