2 * Copyright © 2019 iconectiv
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.openecomp.sdcrests.externaltesting.rest;
19 import io.swagger.v3.oas.annotations.info.Info;
20 import io.swagger.v3.oas.annotations.tags.Tag;
21 import io.swagger.v3.oas.annotations.tags.Tags;
22 import java.util.List;
23 import javax.ws.rs.Consumes;
24 import javax.ws.rs.GET;
25 import javax.ws.rs.POST;
26 import javax.ws.rs.PUT;
27 import javax.ws.rs.Path;
28 import javax.ws.rs.PathParam;
29 import javax.ws.rs.Produces;
30 import javax.ws.rs.QueryParam;
31 import javax.ws.rs.core.MediaType;
32 import javax.ws.rs.core.Response;
33 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
34 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
35 import org.openecomp.core.externaltesting.api.ClientConfiguration;
36 import org.openecomp.core.externaltesting.api.RemoteTestingEndpointDefinition;
37 import org.springframework.validation.annotation.Validated;
39 @Path("/v1.0/externaltesting")
40 @Produces(MediaType.APPLICATION_JSON)
41 @Consumes(MediaType.APPLICATION_JSON)
42 @Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "External-Testing")})
45 public interface ExternalTesting {
53 Response setConfig(ClientConfiguration config);
56 @Path("/testcasetree")
57 Response getTestCasesAsTree();
61 Response getEndpoints();
65 Response setEndpoints(List<RemoteTestingEndpointDefinition> endpoints);
68 @Path("/endpoints/{endpointId}/scenarios")
69 Response getScenarios(@PathParam("endpointId") String endpointId);
72 @Path("/endpoints/{endpointId}/scenarios/{scenario}/testsuites")
73 Response getTestsuites(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario);
76 @Path("/endpoints/{endpointId}/scenarios/{scenario}/testcases")
77 Response getTestcases(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario);
80 @Path("/endpoints/{endpointId}/scenarios/{scenario}/testsuites/{testsuite}/testcases/{testcase}")
81 Response getTestcase(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario,
82 @PathParam("testsuite") String testsuite, @PathParam("testcase") String testcase);
85 @Path("/endpoints/{endpointId}/executions/{executionId}")
86 Response getExecution(@PathParam("endpointId") String endpointId, @PathParam("executionId") String executionId);
91 @Consumes(MediaType.MULTIPART_FORM_DATA)
92 Response execute(@QueryParam("vspId") String vspId, @QueryParam("vspVersionId") String vspVersionId,
93 @QueryParam("requestId") String requestId,
94 @Multipart(value = "files", required = false) List<Attachment> files,
95 @Multipart(value = "testdata", required = false) String testData);
99 Response getValidationResult(@QueryParam("requestId") String requestId,
100 @QueryParam("endPoint") List<String> endPoints);