Fix issue where apex-pdp test is failing in gitlab 92/121292/1
authora.sreekumar <ajith.sreekumar@bell.ca>
Wed, 12 May 2021 16:32:01 +0000 (17:32 +0100)
committera.sreekumar <ajith.sreekumar@bell.ca>
Wed, 12 May 2021 16:32:08 +0000 (17:32 +0100)
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 <ajith.sreekumar@bell.ca>
testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java

index 93ca6ad..08860b0 100644 (file)
@@ -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\"");
     }
 }