From 6dfab64262ea5816c761042192c84e498a3177ab Mon Sep 17 00:00:00 2001 From: jhh Date: Wed, 12 Feb 2020 18:20:06 -0600 Subject: tosca compliant op policy support + vcpe test Tosca Compliant and Toscal Legacy Operational policies are both supported for backwards compatibility. vCPE usecase junits to support 2 equivalent policies, one tosca compliant and the other one legacy. Issue-ID: POLICY-2360 Signed-off-by: jhh Change-Id: Iafbfc92bbec42e6a3fe4ceb4a9a17c85e636ea14 Signed-off-by: jhh --- .../server/restful/RestControlLoopManagerTest.java | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'controlloop/common/feature-controlloop-management/src/test') diff --git a/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java b/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java index c2a9e536f..7fad4468d 100644 --- a/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java +++ b/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-2020 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. @@ -28,11 +28,9 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Collections; import java.util.Properties; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; -import javax.ws.rs.client.Entity; import javax.ws.rs.core.Response.Status; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -179,25 +177,6 @@ public class RestControlLoopManagerTest { assertEquals(Status.NOT_FOUND.getStatusCode(), HttpClientFactoryInstance.getClientFactory() .get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus()); - - String policyFromFile = new String(Files.readAllBytes(Paths.get(POLICY))); - HttpClientFactoryInstance.getClientFactory().get(CONTROLLER).put( - URL_CONTEXT_PATH_CONTROLLOOP_POLICY, Entity.text(policyFromFile), - Collections.emptyMap()); - - assertEquals(Status.OK.getStatusCode(), HttpClientFactoryInstance.getClientFactory() - .get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus()); - - String policyFromPdpD = HttpClientFactoryInstance.getClientFactory().get(CONTROLLER) - .get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).readEntity(String.class); - - assertEquals(policyFromFile, policyFromPdpD); - - assertEquals(Status.CONFLICT.getStatusCode(), - HttpClientFactoryInstance.getClientFactory().get(CONTROLLER) - .put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY, Entity.text(policyFromFile), - Collections.emptyMap()) - .getStatus()); } /** -- cgit 1.2.3-korg