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 {
30 public ServiceReqDetails(String serviceName, String category, ArrayList<String> tags, String description,
31 String contactId, String icon) {
32 this.name = serviceName;
33 // this.category = category;
35 this.description = description;
36 this.contactId = contactId;
38 projectCode = "12345";
39 CategoryDefinition categoryDefinition = new CategoryDefinition();
40 categoryDefinition.setName(category);
41 categories = new ArrayList<>();
42 categories.add(categoryDefinition);
46 public ServiceReqDetails(Service service) {
47 this.contactId = service.getContactId();
48 this.categories = service.getCategories();
49 this.creatorUserId = service.getCreatorUserId();
50 this.creatorFullName = service.getCreatorFullName();
51 this.description = service.getDescription();
52 this.icon = service.getIcon();
53 this.name = service.getName();
54 this.projectCode = service.getProjectCode();
55 this.tags = service.getTags();
56 this.uniqueId = service.getUniqueId();
57 this.UUID = service.getUUID();
58 this.version = service.getVersion();
62 public ServiceReqDetails() {
64 projectCode = "12345";
67 public ServiceReqDetails(ServiceReqDetails a, String newServiceName) {
68 a.setName(newServiceName);
72 public String toString() {
73 return "ServiceDetails [name=" + name + ", category=" + getCategory() + ", tags=" + tags + ", description="
74 + description + ", contactId=" + contactId + ", icon=" + icon + "]";
77 public ServiceReqDetails(ServiceReqDetails aService) {
78 this(aService.getName(), aService.getCategory(), (ArrayList<String>) aService.getTags(),
79 aService.getDescription(), aService.getContactId(), aService.getIcon());
80 uniqueId = aService.getUniqueId();
81 version = aService.getVersion();
84 public String getCategory() {
85 if (categories != null && categories.size() >= 1) {
86 return categories.get(0).getName();