From 658e67bc821a3bc55f2c6d877e7e0baa21427333 Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Mon, 25 Jan 2021 11:03:42 +0000 Subject: Improve handling of multiple policy in APEX PDP Change-Id: Ic4adf5bd8876dc31fc93993298e90389baaa2c39 Issue-ID: POLICY-2883 Signed-off-by: a.sreekumar --- .../carrier/restrequestor/RestRequestorTest.java | 24 ++++++---------------- 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor') diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java index 2a36006eb..013046444 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2021 Bell Canada. 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. @@ -21,6 +22,7 @@ package org.onap.policy.apex.plugins.event.carrier.restrequestor; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.awaitility.Awaitility.await; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -267,28 +269,14 @@ public class RestRequestorTest { /** * Test REST requestor producer alone. - * - * @throws MessagingException the messaging exception - * @throws ApexException the apex exception - * @throws IOException Signals that an I/O exception has occurred. */ @Test - public void testRestRequestorProducerAlone() throws MessagingException, ApexException, IOException { - System.setOut(new PrintStream(outContent)); - System.setErr(new PrintStream(errContent)); - + public void testRestRequestorProducerAlone() { final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FileGetProducerAlone.json"}; + assertThatThrownBy(() -> new ApexMain(args)) + .hasRootCauseMessage("REST Requestor producer (RestRequestorProducer) " + + "must run in peered requestor mode with a REST Requestor consumer"); - ApexMain apexMain = new ApexMain(args); - apexMain.shutdown(); - - final String outString = outContent.toString(); - - System.setOut(stdout); - System.setErr(stderr); - - assertTrue(outString.contains("REST Requestor producer (RestRequestorProducer) " - + "must run in peered requestor mode with a REST Requestor consumer")); } /** -- cgit 1.2.3-korg