2 * Copyright © 2016-2018 European Support Limited
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.
17 package org.openecomp.activityspec.mocks;
20 import java.util.ArrayList;
21 import java.util.Collections;
22 import java.util.List;
23 import java.util.stream.Collectors;
24 import org.openecomp.sdc.versioning.dao.types.VersionStatus;
25 import org.openecomp.sdc.versioning.types.Item;
26 import org.openecomp.sdc.versioning.ItemManager;
27 import java.util.Collection;
28 import java.util.UUID;
29 import java.util.function.Predicate;
31 public class ItemManagerMock implements ItemManager {
38 public Collection<Item> list(Predicate<Item> predicate) {
39 List<Item> items = new ArrayList<>();
41 Collection<Item> collection = items;
46 public Item get(String itemId) {
51 public Item create(Item item) {
52 this.id = UUID.randomUUID().toString();
59 public void updateVersionStatus(String itemId, VersionStatus addedVersionStatus,
60 VersionStatus removedVersionStatus) {
67 public void updateName(String itemId, String name) {
72 public void update(Item item) {
77 public void delete(Item item) {