From a23bd8c218d7044e1d79e240fdb74f00947a3108 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Tue, 18 Jun 2024 15:12:56 +0100 Subject: Convert junit4 to junit5 - clean up any references to junit4 - clean up some sonar complaints - remove not used integration tests Issue-ID: POLICY-5041 Change-Id: I67e7a8f00df5b6c5ba514f4ea2ecd96bf942d4c7 Signed-off-by: adheli.tavares --- .../java/org/onap/policy/apex/auth/clieditor/FileMacroTest.java | 8 ++++++-- .../java/org/onap/policy/apex/auth/clieditor/LogicBlockTest.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'auth/cli-editor/src/test/java/org/onap') diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/FileMacroTest.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/FileMacroTest.java index d407e5a4e..443727236 100644 --- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/FileMacroTest.java +++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/FileMacroTest.java @@ -46,6 +46,8 @@ class FileMacroTest { private File tempModelFile; private File tempLogFile; + private static final String WHITESPACE_REGEX = "(\\s+){1,4}"; + /** * Creates the temp files. * @@ -101,11 +103,13 @@ class FileMacroTest { final File outputLogFile = new File(tempLogFile.getCanonicalPath()); final String outputLogString = TextFileUtils.getTextFileAsString(outputLogFile.getCanonicalPath()) - .replace(Paths.get("").toAbsolutePath() + File.separator, "").replaceAll("\\s+", ""); + .replace(Paths.get("").toAbsolutePath() + File.separator, "") + .replaceAll(WHITESPACE_REGEX, ""); // We compare the log to what we expect to get final String outputLogCompareString = TextFileUtils - .getTextFileAsString("src/test/resources/compare/FileMacro_Compare.log").replaceAll("\\s+", ""); + .getTextFileAsString("src/test/resources/compare/FileMacro_Compare.log") + .replaceAll(WHITESPACE_REGEX, ""); // Check what we got is what we expected to get assertEquals(outputLogCompareString, outputLogString); diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/LogicBlockTest.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/LogicBlockTest.java index e30780ca0..982d5195e 100644 --- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/LogicBlockTest.java +++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/LogicBlockTest.java @@ -96,7 +96,7 @@ class LogicBlockTest { writtenModel.getKeyInformation().getKeyInfoMap().clear(); compareModel.getKeyInformation().getKeyInfoMap().clear(); - assertEquals(writtenModel, compareModel); + assertEquals(compareModel, writtenModel); } /** -- cgit 1.2.3-korg