2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.dao.utils;
23 import org.apache.tinkerpop.gremlin.structure.T;
24 import org.junit.Assert;
25 import org.junit.Test;
29 public class CollectionUtilsTest {
32 public void testMerge() throws Exception {
39 result = CollectionUtils.merge(source, target);
40 Assert.assertEquals(null, result);
44 result = CollectionUtils.merge(source, target);
45 Assert.assertEquals(null, result);
49 public void testMerge_1() throws Exception {
50 Map<String, String> source = new HashMap();
51 Map<String, String> target = new HashMap();
52 boolean override = false;
53 Map<String, String> result;
55 result = CollectionUtils.merge(source, target, override);
56 Assert.assertEquals(null, result);
60 result = CollectionUtils.merge(source, target, override);
61 Assert.assertEquals(null, result);
65 result = CollectionUtils.merge(source, target, override);
66 Assert.assertEquals(null, result);
70 public void testMerge_2() throws Exception {
71 List<T> source = new LinkedList<>();
72 List<T> target = new LinkedList<>();
76 result = CollectionUtils.merge(source, target);
77 Assert.assertEquals(target, result);