2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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.ci.tests.datatypes;
23 import java.util.ArrayList;
25 import org.openecomp.sdc.be.model.Service;
26 import org.openecomp.sdc.be.model.category.CategoryDefinition;
28 public class ServiceReqDetails extends ComponentReqDetails {
33 public ServiceReqDetails(String serviceName, String category, ArrayList<String> tags, String description,
34 String contactId, String icon) {
35 this.name = serviceName;
36 // this.category = category;
38 this.description = description;
39 this.contactId = contactId;
41 this.serviceType = "";
42 this.serviceRole = "";
43 projectCode = "12345";
44 CategoryDefinition categoryDefinition = new CategoryDefinition();
45 categoryDefinition.setName(category);
46 categories = new ArrayList<>();
47 categories.add(categoryDefinition);
51 public ServiceReqDetails(Service service) {
52 this.contactId = service.getContactId();
53 this.categories = service.getCategories();
54 this.creatorUserId = service.getCreatorUserId();
55 this.creatorFullName = service.getCreatorFullName();
56 this.description = service.getDescription();
57 this.icon = service.getIcon();
58 this.name = service.getName();
59 this.projectCode = service.getProjectCode();
60 this.tags = service.getTags();
61 this.uniqueId = service.getUniqueId();
62 this.UUID = service.getUUID();
63 this.version = service.getVersion();
64 this.serviceType = service.getServiceType();
65 this.serviceRole = service.getServiceRole();
69 public ServiceReqDetails() {
71 projectCode = "12345";
74 public ServiceReqDetails(ServiceReqDetails a, String newServiceName) {
75 a.setName(newServiceName);
79 public String toString() {
80 return "ServiceDetails [name=" + name + ", category=" + getCategory() + ", tags=" + tags + ", description="
81 + description + ", contactId=" + contactId + ", icon=" + icon + "]";
84 public ServiceReqDetails(ServiceReqDetails aService) {
85 this(aService.getName(), aService.getCategory(), (ArrayList<String>) aService.getTags(),
86 aService.getDescription(), aService.getContactId(), aService.getIcon());
87 uniqueId = aService.getUniqueId();
88 version = aService.getVersion();
91 public String getCategory() {
92 if (categories != null && categories.size() >= 1) {
93 return categories.get(0).getName();