2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright 2020 China Mobile. All rights reserved.
6 * Copyright (C) 2022 Wipro Limited.
7 *=================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.datalake.des.domain;
24 import static org.junit.Assert.assertEquals;
25 import static org.junit.Assert.assertNotEquals;
26 import static org.junit.Assert.assertNotNull;
27 import static org.junit.Assert.assertNull;
28 import static org.junit.Assert.assertTrue;
30 import org.junit.Test;
37 public class DbTypeTest {
41 DbType dbType = new DbType("ES", "Elasticsearch");
43 dbType.setTool(false);
45 assertNotNull(dbType.toString());
46 assertEquals(dbType, dbType);
47 assertNotEquals(dbType, null);
48 assertNotEquals(dbType, "ES");
50 DbType dbType2 = new DbType();
51 dbType2.setId("MONGO");
52 dbType2.setName("MongoDB");
53 assertNotEquals(dbType, dbType2);
54 assertNotNull(dbType.hashCode());
56 assertEquals("MongoDB", dbType2.getName());
57 dbType2.setName(null);
58 dbType2.setDefaultPort(1);
59 assertTrue(1 == dbType2.getDefaultPort());
62 assertNull(dbType2.getDbs());