From b599e62ad4e142da77e0500068e198350454a1d2 Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Wed, 12 May 2021 17:32:01 +0100 Subject: [PATCH] Fix issue where apex-pdp test is failing in gitlab One of the testcases in APEX-PDP is failing only in gitlab, but not failing in jenkins or local builds. The reason is "/I/Dont/Exist*" is an invlaid path in jenkins etc, but it is valid in gitlab somehow. Changing this to "/I/Dont/Exist\0" so that the path is invalid irrespective of the build platform. Change-Id: I42bbc9ae21f0d827082f446f8dd416dcc10349e2 Issue-ID: POLICY-3306 Signed-off-by: a.sreekumar --- .../performance/benchmark/eventgenerator/EventGeneratorTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java index 93ca6ad70..08860b013 100644 --- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. + * Modifications Copyright (C) 2020-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 +21,7 @@ package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -139,7 +140,7 @@ public class EventGeneratorTest { @Test public void testEventGeneratorOutfileBad() { EventGeneratorParameters pars = new EventGeneratorParameters(); - pars.setOutFile("/I/Dont/Exist*"); + pars.setOutFile("/I/Dont/Exist\0"); EventGenerator generator = new EventGenerator(pars); assertNotNull(generator); @@ -150,6 +151,6 @@ public class EventGeneratorTest { final String outString = outContent.toString(); System.setOut(stdout); - assertTrue(outString.contains("could not output statistics to file \"/I/Dont/Exist*\"")); + assertThat(outString).contains("could not output statistics to file \"/I/Dont/Exist\0\""); } } -- 2.16.6