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 {
32 String environmentContext;
34 public ServiceReqDetails(String serviceName, String category, ArrayList<String> tags, String description,
35 String contactId, String icon) {
36 this.name = serviceName;
37 // this.category = category;
39 this.description = description;
40 this.contactId = contactId;
42 this.serviceType = "";
43 this.serviceRole = "";
44 projectCode = "12345";
45 CategoryDefinition categoryDefinition = new CategoryDefinition();
46 categoryDefinition.setName(category);
47 categories = new ArrayList<>();
48 categories.add(categoryDefinition);
49 this.environmentContext = "";
52 public ServiceReqDetails(Service service) {
53 this.contactId = service.getContactId();
54 this.categories = service.getCategories();
55 this.creatorUserId = service.getCreatorUserId();
56 this.creatorFullName = service.getCreatorFullName();
57 this.description = service.getDescription();
58 this.icon = service.getIcon();
59 this.name = service.getName();
60 this.projectCode = service.getProjectCode();
61 this.tags = service.getTags();
62 this.uniqueId = service.getUniqueId();
63 this.UUID = service.getUUID();
64 this.version = service.getVersion();
65 this.serviceType = service.getServiceType();
66 this.serviceRole = service.getServiceRole();
67 this.environmentContext = service.getEnvironmentContext();
70 public ServiceReqDetails() {
72 projectCode = "12345";
75 public ServiceReqDetails(ServiceReqDetails a, String newServiceName) {
76 a.setName(newServiceName);
80 public String toString() {
81 return "ServiceDetails [name=" + name + ", category=" + getCategory() + ", tags=" + tags + ", description="
82 + description + ", contactId=" + contactId + ", icon=" + icon + "]";
85 public ServiceReqDetails(ServiceReqDetails aService) {
86 this(aService.getName(), aService.getCategory(), (ArrayList<String>) aService.getTags(),
87 aService.getDescription(), aService.getContactId(), aService.getIcon());
88 uniqueId = aService.getUniqueId();
89 version = aService.getVersion();
92 public String getCategory() {
93 if (categories != null && categories.size() >= 1) {
94 return categories.get(0).getName();
99 public String getEnvironmentContext() {
100 return environmentContext;
103 public void setEnvironmentContext(String environmentContext) {
104 this.environmentContext = environmentContext;