Upload the ESR server seed code.
[aai/esr-server.git] / esr-core / esr-mgr / src / test / java / org / onap / aai / esr / db / util / CatalogDbUtilTest.java
1 /**
2  * Copyright 2016 ZTE Corporation.
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.onap.aai.esr.db.util;
17
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertNotNull;
20
21 import org.junit.Test;
22 import org.onap.aai.esr.util.ExtsysDbUtil;
23
24 public class CatalogDbUtilTest {
25
26   @Test
27   public void when_generate_id_is_not_null() {
28     String actualUuid = ExtsysDbUtil.generateId();
29     assertNotNull(actualUuid);
30   }
31
32   @Test
33   public void when_input_empty_string_output_false() {
34     boolean expect = false;
35     boolean actual = ExtsysDbUtil.isNotEmpty("");
36     assertEquals(expect, actual);
37   }
38
39   @Test
40   public void when_input_blan_string_output_true() {
41     boolean expect = true;
42     boolean actual = ExtsysDbUtil.isNotEmpty(" ");
43     assertEquals(expect, actual);
44   }
45
46   @Test
47   public void when_input_null_string_output_false() {
48     boolean expect = false;
49     boolean actual = ExtsysDbUtil.isNotEmpty(null);
50     assertEquals(expect, actual);
51   }
52
53   @Test
54   public void when_input_str_string_output_true() {
55     boolean expect = true;
56     boolean actual = ExtsysDbUtil.isNotEmpty("str");
57     assertEquals(expect, actual);
58   }
59
60 }