2a0586c00301ff9d0cb713213e94eb2eddd89c63
[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.List;
22 import org.openecomp.sdc.versioning.dao.types.VersionStatus;
23 import org.openecomp.sdc.versioning.types.Item;
24 import org.openecomp.sdc.versioning.ItemManager;
25 import java.util.Collection;
26 import java.util.UUID;
27 import java.util.function.Predicate;
28
29 public class ItemManagerMock implements ItemManager {
30
31   private String id;
32   private Item item;
33
34
35   @Override
36   public Collection<Item> list(Predicate<Item> predicate) {
37     List<Item> items = new ArrayList<>();
38     items.add(item);
39     return items;
40   }
41
42   @Override
43   public Item get(String itemId) {
44     return null;
45   }
46
47   @Override
48   public Item create(Item item) {
49     this.id = UUID.randomUUID().toString();
50     item.setId(this.id);
51     this.item  = item;
52     return item;
53   }
54
55   @Override
56   public void updateVersionStatus(String itemId, VersionStatus addedVersionStatus,
57                                   VersionStatus removedVersionStatus) {
58
59   }
60
61   @Override
62   public void archive(Item item) {
63
64   }
65
66   @Override
67   public void restore(Item item) {
68
69   }
70
71
72   @Override
73   public void updateName(String itemId, String name) {
74
75   }
76
77   @Override
78   public void update(Item item) {
79
80   }
81
82   @Override
83   public void delete(Item item) {
84
85   }
86
87 }