From ad9f3334d908cce1d4c3c0f0d71a64f7ab6e6084 Mon Sep 17 00:00:00 2001 From: sebdet Date: Sun, 24 Jan 2021 16:40:18 +0100 Subject: Add new Camel route Add the new rest endpoint in camel + add new permission type + add robot test for that route + small refactoring of trst files Issue-ID: POLICY-2924 Signed-off-by: sebdet Change-Id: I623cc8ec1724513cdb92eeea000adca5c2433bae (cherry picked from commit 9d04a9cc8c6f4b12ae60cc0d4d42f71085f72328) --- src/test/java/org/onap/policy/clamp/clds/it/RobotItCase.java | 11 ++++++++++- .../policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/test/java/org/onap') diff --git a/src/test/java/org/onap/policy/clamp/clds/it/RobotItCase.java b/src/test/java/org/onap/policy/clamp/clds/it/RobotItCase.java index 8c06929e1..2f17c61bf 100644 --- a/src/test/java/org/onap/policy/clamp/clds/it/RobotItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/it/RobotItCase.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP CLAMP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights + * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,6 +23,8 @@ package org.onap.policy.clamp.clds.it; +import static org.apache.commons.io.FileUtils.copyInputStreamToFile; + import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.github.dockerjava.api.DockerClient; @@ -111,6 +113,13 @@ public class RobotItCase { } catch (InterruptedException e) { throw new Exception("Failed to retrieve logs of container " + id, e); } + + copyInputStreamToFile(client.copyArchiveFromContainerCmd(id, "/opt/robotframework/reports/output.xml").exec(), + new File("target/robotframework/output.xml")); + copyInputStreamToFile(client.copyArchiveFromContainerCmd(id, "/opt/robotframework/reports/log.html").exec(), + new File("target/robotframework/log.html")); + copyInputStreamToFile(client.copyArchiveFromContainerCmd(id, "/opt/robotframework/reports/report.html").exec(), + new File("target/robotframework/report.html")); client.stopContainerCmd(id); } } diff --git a/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java b/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java index b3fd3f19a..5da68f47f 100644 --- a/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java +++ b/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java @@ -94,8 +94,8 @@ public class PoliciesPdpMergerTest { @Test public void testUpdatePdpGroupOfPolicyModels() throws IOException { - JSONAssert.assertEquals(ResourceFileUtils.getResourceAsString("clds/policy-merger.json"), PoliciesPdpMerger - .mergePoliciesAndPdpGroupStates( + JSONAssert.assertEquals(ResourceFileUtils.getResourceAsString("example/policy/policy-merger.json"), + PoliciesPdpMerger.mergePoliciesAndPdpGroupStates( ResourceFileUtils.getResourceAsString("http-cache/example/policy/api/v1/policies/.file"), pdpGroupsJson), true); } -- cgit 1.2.3-korg