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') 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 c2555fa3b262da7b8d'>refslogtreecommitdiffstats
blob: a16dfcc2bda55bf7b6acdacd71c07e6dcacb5abe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90