/
ZephyrRestService.java
211 lines (183 loc) · 5.87 KB
/
ZephyrRestService.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
package com.thed.service;
import com.thed.model.*;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Created by prashant on 20/6/19.
*/
public interface ZephyrRestService {
/**
* Verifies given credentials
* @param hostUrl
* @param username
* @param password
* @return
* @throws URISyntaxException
*/
public Boolean verifyCredentials(String hostUrl, String username, String password) throws URISyntaxException;
/**
* Verifies given credentials and stores hostAddress if verification succeeds
* @param hostAddress
* @param username
* @param password
* @return
* @throws URISyntaxException
*/
Boolean login(String hostAddress, String username, String password) throws URISyntaxException;
/**
* Get project using project id.
* @param projectId
* @return
* @throws URISyntaxException
*/
Project getProjectById(Long projectId) throws URISyntaxException;
/**
* Create a new cycle with given cycle.
* @param cycle
* @return
*/
Cycle createCycle(Cycle cycle) throws URISyntaxException;
/**
* Get all projects for current user.
* @return
*/
public List<Project> getAllProjectsForCurrentUser() throws URISyntaxException;
/**
* Get all releases for given projectId.
* @param projectId
* @return
* @throws URISyntaxException
*/
List<Release> getAllReleasesForProjectId(Long projectId) throws URISyntaxException;
/**
* Get all cycles for given releaseId.
* @param releaseId
* @return
* @throws URISyntaxException
*/
List<Cycle> getAllCyclesForReleaseId(Long releaseId) throws URISyntaxException;
/**
* Get all tree nodes such as phases for given releaseId.
* @param type
* @param revisionId
* @param releaseId
* @return
* @throws URISyntaxException
*/
List<TCRCatalogTreeDTO> getTCRCatalogTreeNodes(String type, Long revisionId, Long releaseId) throws URISyntaxException;
/**
* Get tcrCatalogTree node for given id.
* @param tcrCatalogTreeId
* @return
* @throws URISyntaxException
*/
TCRCatalogTreeDTO getTCRCatalogTreeNode(Long tcrCatalogTreeId) throws URISyntaxException;
/**
* Create a tree node such as phase.
* @param tcrCatalogTreeDTO
* @return
* @throws URISyntaxException
*/
TCRCatalogTreeDTO createTCRCatalogTreeNode(TCRCatalogTreeDTO tcrCatalogTreeDTO) throws URISyntaxException;
/**
* Create mappings between testcase and requirements given.
* @param mapTestcaseToRequirements
* @return
* @throws URISyntaxException
*/
List<String> mapTestcaseToRequirements(List<MapTestcaseToRequirement> mapTestcaseToRequirements) throws URISyntaxException;
/**
* Get testcases for given tree id.
* @param tcrCatalogTreeId
* @return
* @throws URISyntaxException
*/
List<TCRCatalogTreeTestcase> getTestcasesForTreeId(Long tcrCatalogTreeId) throws URISyntaxException;
/**
* Create testcases in bulk
* @param tcrCatalogTreeTestcases
* @return
* @throws URISyntaxException
*/
List<TCRCatalogTreeTestcase> createTestcases(List<TCRCatalogTreeTestcase> tcrCatalogTreeTestcases) throws URISyntaxException;
/**
* Get cycle for id.
* @param cycleId
* @return
* @throws URISyntaxException
*/
Cycle getCycleById(Long cycleId) throws URISyntaxException;
/**
* Create cycle phase.
* @param cyclePhase
* @return
* @throws URISyntaxException
*/
CyclePhase createCyclePhase(CyclePhase cyclePhase) throws URISyntaxException;
/**
* Adds testcases to free form cycle phase.
* @param cyclePhase
* @param treeTestcaseMap
* @param includeHierarchy
* @return
* @throws URISyntaxException
*/
String addTestcasesToFreeFormCyclePhase(CyclePhase cyclePhase, Map<Long, Set<Long>> treeTestcaseMap, Boolean includeHierarchy) throws URISyntaxException;
/**
* Assigns cycle phase to creator.
* @param cyclePhaseId
* @return
* @throws URISyntaxException
*/
Integer assignCyclePhaseToCreator(Long cyclePhaseId) throws URISyntaxException;
/**
* Get testcases scheduled under this cycle phase.
* @param cyclePhaseId
* @return
* @throws URISyntaxException
*/
List<ReleaseTestSchedule> getReleaseTestSchedules(Long cyclePhaseId) throws URISyntaxException;
/**
* Execute given releaseTestSchedule ids with given status.
* @param rtsIds
* @param executionStatus
* @return
* @throws URISyntaxException
*/
List<ReleaseTestSchedule> executeReleaseTestSchedules(Set<Long> rtsIds, String executionStatus) throws URISyntaxException;
/**
* Upload all the attachments from list given.
* @param attachmentDTOs
* @return
* @throws URISyntaxException
*/
List<GenericAttachmentDTO> uploadAttachments(List<GenericAttachmentDTO> attachmentDTOs) throws URISyntaxException;
/**
* Add attachments to items(ex: testcase, requirement, etc.) with given details.
* @param attachments
* @return
* @throws URISyntaxException
*/
List<Attachment> addAttachment(List<Attachment> attachments) throws URISyntaxException;
/**
* Add testStep to single testcase.
* @param testStep
* @return
* @throws URISyntaxException
*/
TestStep addTestStep(TestStep testStep) throws URISyntaxException;
/**
* Add testStep results.
* @param testStepResults
* @return
* @throws URISyntaxException
*/
List<TestStepResult> addTestStepsResults(List<TestStepResult> testStepResults) throws URISyntaxException;
User getCurrentUser();
/**
* Clears all data saved in this instance and related to this.
*/
void clear();
}