2 * Copyright 2022 Samsung Electronics
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package org.onap.cli.fw.cmd.error;
\r
19 import org.junit.Test;
\r
21 import static org.junit.Assert.assertEquals;
\r
23 public class OnapCommandFailTest {
\r
26 public void OnapCommandCmdFailureTest() {
\r
27 OnapCommandCmdFailure onapCommandCmdFailure = new OnapCommandCmdFailure("Argument value missing");
\r
28 assertEquals("0x18001::Argument value missing", onapCommandCmdFailure.getMessage());
\r
32 public void OnapCommandCmdFailureWithCodeTest() {
\r
33 OnapCommandCmdFailure onapCommandCmdFailure = new OnapCommandCmdFailure("Argument value missing",101);
\r
34 assertEquals("101::0x18001::Argument value missing", onapCommandCmdFailure.getMessage());
\r
38 public void OnapCommandCmdFailureThrowableTest() {
\r
39 OnapCommandCmdFailure onapCommandCmdFailure = new OnapCommandCmdFailure(new Exception("Argument value missing"));
\r
40 assertEquals("0x18001::Argument value missing", onapCommandCmdFailure.getMessage());
\r
44 public void OnapCommandCmdFailureWithCodeThrowableTest() {
\r
45 OnapCommandCmdFailure onapCommandCmdFailure = new OnapCommandCmdFailure(new Exception("Argument value missing"),101);
\r
46 assertEquals("101::0x18001::Argument value missing", onapCommandCmdFailure.getMessage());
\r