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.OpenAPIDefinition;
20 import io.swagger.v3.oas.annotations.info.Info;
21 import java.util.List;
22 import javax.ws.rs.Consumes;
23 import javax.ws.rs.GET;
24 import javax.ws.rs.POST;
25 import javax.ws.rs.PUT;
26 import javax.ws.rs.Path;
27 import javax.ws.rs.PathParam;
28 import javax.ws.rs.Produces;
29 import javax.ws.rs.QueryParam;
30 import javax.ws.rs.core.MediaType;
31 import javax.ws.rs.core.Response;
32 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
33 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
34 import org.openecomp.core.externaltesting.api.ClientConfiguration;
35 import org.openecomp.core.externaltesting.api.RemoteTestingEndpointDefinition;
36 import org.springframework.validation.annotation.Validated;
38 @Path("/v1.0/externaltesting")
39 @Produces(MediaType.APPLICATION_JSON)
40 @Consumes(MediaType.APPLICATION_JSON)
41 @OpenAPIDefinition(info = @Info(title = "External-Testing"))
44 public interface ExternalTesting {
52 Response setConfig(ClientConfiguration config);
55 @Path("/testcasetree")
56 Response getTestCasesAsTree();
60 Response getEndpoints();
64 Response setEndpoints(List<RemoteTestingEndpointDefinition> endpoints);
67 @Path("/endpoints/{endpointId}/scenarios")
68 Response getScenarios(@PathParam("endpointId") String endpointId);
71 @Path("/endpoints/{endpointId}/scenarios/{scenario}/testsuites")
72 Response getTestsuites(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario);
75 @Path("/endpoints/{endpointId}/scenarios/{scenario}/testcases")
76 Response getTestcases(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario);
79 @Path("/endpoints/{endpointId}/scenarios/{scenario}/testsuites/{testsuite}/testcases/{testcase}")
80 Response getTestcase(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario,
81 @PathParam("testsuite") String testsuite, @PathParam("testcase") String testcase);
84 @Path("/endpoints/{endpointId}/executions/{executionId}")
85 Response getExecution(@PathParam("endpointId") String endpointId, @PathParam("executionId") String executionId);
90 @Consumes(MediaType.MULTIPART_FORM_DATA)
91 Response execute(@QueryParam("vspId") String vspId, @QueryParam("vspVersionId") String vspVersionId,
92 @QueryParam("requestId") String requestId,
93 @Multipart(value = "files", required = false) List<Attachment> files,
94 @Multipart(value = "testdata", required = false) String testData);
98 Response getValidationResult(@QueryParam("requestId") String requestId,
99 @QueryParam("endPoint") List<String> endPoints);