2 * Copyright 2016-2017 ZTE Corporation.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.aai.esr.db.util;
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertNotNull;
21 import org.junit.Test;
22 import org.onap.aai.esr.util.ExtsysUtil;
24 public class CatalogDbUtilTest {
27 public void when_generate_id_is_not_null() {
28 String actualUuid = ExtsysUtil.generateId();
29 assertNotNull(actualUuid);
33 public void when_input_empty_string_output_false() {
34 boolean expect = false;
35 boolean actual = ExtsysUtil.isNotEmpty("");
36 assertEquals(expect, actual);
40 public void when_input_blan_string_output_true() {
41 boolean expect = true;
42 boolean actual = ExtsysUtil.isNotEmpty(" ");
43 assertEquals(expect, actual);
47 public void when_input_null_string_output_false() {
48 boolean expect = false;
49 boolean actual = ExtsysUtil.isNotEmpty(null);
50 assertEquals(expect, actual);
54 public void when_input_str_string_output_true() {
55 boolean expect = true;
56 boolean actual = ExtsysUtil.isNotEmpty("str");
57 assertEquals(expect, actual);