From cc035870af8fa909fc19774f0b9382cf00e051a8 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 10 May 2021 12:52:21 -0400 Subject: Fix sonars in policy-gui Fixed: - use "var" Only fixed the ones I saw visually, as SonarLint wouldn't run - something about missing node.js. Issue-ID: POLICY-3094 Change-Id: I594d424b42ce446d86724d75b1dd9ec868c14f2b Signed-off-by: Jim Hahn --- .../onap/policy/gui/editors/apex/rest/ApexEditorStartupTest.java | 9 +++++---- .../org/onap/policy/gui/editors/apex/rest/RestInterfaceTest.java | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'gui-editors/gui-editor-apex/src/test') diff --git a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/ApexEditorStartupTest.java b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/ApexEditorStartupTest.java index d78eba3..717da11 100644 --- a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/ApexEditorStartupTest.java +++ b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/ApexEditorStartupTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. 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. @@ -334,15 +335,15 @@ public class ApexEditorStartupTest { */ private String runEditor(final String[] args) throws InterruptedException { ParameterService.clear(); - final ByteArrayOutputStream outBaStream = new ByteArrayOutputStream(); - final PrintStream outStream = new PrintStream(outBaStream); + final var outBaStream = new ByteArrayOutputStream(); + final var outStream = new PrintStream(outBaStream); - final ApexEditorMain editorMain = new ApexEditorMain(args, outStream); + final var editorMain = new ApexEditorMain(args, outStream); // This test must be started in a thread because we want to intercept the output // in cases where the editor is // started infinitely - final Runnable testThread = new Runnable() { + final var testThread = new Runnable() { @Override public void run() { editorMain.init(); diff --git a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/RestInterfaceTest.java b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/RestInterfaceTest.java index cf1c4fa..3506dab 100644 --- a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/RestInterfaceTest.java +++ b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/RestInterfaceTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. 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. @@ -76,10 +77,10 @@ public class RestInterfaceTest { // Start the editor editorMain = new ApexEditorMain(EDITOR_MAIN_ARGS, System.out); // prevent a stray stdin value from killing the editor - final ByteArrayInputStream input = new ByteArrayInputStream("".getBytes()); + final var input = new ByteArrayInputStream("".getBytes()); System.setIn(input); // Init the editor in a separate thread - final Runnable testThread = new Runnable() { + final var testThread = new Runnable() { @Override public void run() { editorMain.init(); -- cgit 1.2.3-korg