* 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.
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());