From b6c674891e00f3bac43bd7b4fca06e7a87b8dd34 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Thu, 27 May 2021 10:18:49 +0100 Subject: Fix Sonar Issues on Apex-pdp Changes made into cli-codegen, cli-editor, and core-engine Renamed one test class to match other test classes Issue-ID: POLICY-3093 Change-Id: Ib2d947782021590ffc08d426e7a1607a8c33f98a Signed-off-by: lapentafd --- .../onap/policy/apex/auth/clieditor/CommandLineCommandTest.java | 7 ++++--- 1 file changed, 4 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/CommandLineCommandTest.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/CommandLineCommandTest.java index f05757fc8..15b2b98f3 100644 --- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/CommandLineCommandTest.java +++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/CommandLineCommandTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (c) 2020 Nordix Foundation. + * Copyright (c) 2020-2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.onap.policy.apex.auth.clieditor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import java.util.List; @@ -66,11 +67,11 @@ public class CommandLineCommandTest { commandLineCommand.getApiMethodName(); } - @Test(expected = CommandLineException.class) + @Test() public void testInvalidApiMethod() { commandLineCommand.setApiMethod("fail."); assertEquals("fail.", commandLineCommand.getApiMethod()); - commandLineCommand.getApiMethodName(); + assertThrows(CommandLineException.class, () -> commandLineCommand.getApiMethodName()); } @Test -- cgit 1.2.3-korg