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.onap.sdc.workflow;
19 import static org.onap.sdc.workflow.services.impl.ItemType.WORKFLOW;
21 import org.onap.sdc.common.versioning.persistence.types.InternalItem;
22 import org.onap.sdc.common.versioning.persistence.types.InternalVersion;
23 import org.onap.sdc.common.versioning.services.types.VersionStatus;
24 import org.onap.sdc.workflow.services.types.Workflow;
25 import org.onap.sdc.workflow.services.types.ArchivingStatus;
26 import org.onap.sdc.common.versioning.services.types.Item;
27 import org.onap.sdc.common.versioning.services.types.ItemStatus;
29 public class TestUtil {
31 public static Workflow createWorkflow(int workflowNum, boolean createId, ArchivingStatus archivingStatus) {
32 Workflow workflow = new Workflow();
34 workflow.setId(String.valueOf(workflowNum));
36 workflow.setName("Workflow_" + workflowNum);
37 workflow.setDescription("Description_" + workflowNum);
38 workflow.setArchiving(archivingStatus);
43 public static Item createItem(int itemNum, boolean setType, boolean setId, ItemStatus archivingStatus) {
44 InternalItem item = new InternalItem();
46 item.setId(String.valueOf(itemNum));
48 item.setName("Workflow_" + itemNum);
49 item.setDescription("Description_" + itemNum);
51 item.setType(WORKFLOW.name());
53 item.setStatus(archivingStatus);
57 public static InternalVersion createRetrievedVersion(String id, VersionStatus status) {
58 InternalVersion version = new InternalVersion();
60 version.setStatus(status);