667a97b3a4e77db30647559ff6e0398954869238
[sdc.git] /
1 /*
2  * Copyright © 2016-2018 European Support Limited
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
17 package org.openecomp.activityspec.mocks;
18
19
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;
30
31 public class ItemManagerMock implements ItemManager {
32
33   public String id;
34   public Item item;
35
36
37   @Override
38   public Collection<Item> list(Predicate<Item> predicate) {
39     List<Item> items = new ArrayList<>();
40     items.add(item);
41     Collection<Item> collection = items;
42     return items;
43   }
44
45   @Override
46   public Item get(String itemId) {
47     return null;
48   }
49
50   @Override
51   public Item create(Item item) {
52     this.id = UUID.randomUUID().toString();
53     item.setId(this.id);
54     this.item  = item;
55     return item;
56   }
57
58   @Override
59   public void updateVersionStatus(String itemId, VersionStatus addedVersionStatus,
60                                   VersionStatus removedVersionStatus) {
61
62   }
63
64
65
66   @Override
67   public void updateName(String itemId, String name) {
68
69   }
70
71   @Override
72   public void update(Item item) {
73
74   }
75
76   @Override
77   public void delete(Item item) {
78
79   }
80
81 }