ac2f7fcafa7dab84c37ff09e40948f8bc3efd57c
[sdc.git] / openecomp-be / lib / openecomp-sdc-externaltesting-lib / openecomp-sdc-externaltesting-api / src / main / java / org / openecomp / core / externaltesting / api / ExternalTestingManager.java
1 /*
2  * Copyright © 2019 iconectiv
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.openecomp.core.externaltesting.api;
18
19
20 import java.util.List;
21
22 public interface ExternalTestingManager {
23
24   /**
25    * Return the configuration of this feature that we want to
26    * expose to the client.  Treated as a JSON blob for flexibility.
27    */
28   ClientConfiguration getConfig();
29
30   /**
31    * For testing purposes, set the client configuration.
32    */
33   ClientConfiguration setConfig(ClientConfiguration config);
34
35   /**
36    * Build a tree of all test cases for the client including all
37    * defined endpoints, scenarios, and test suites.
38    * @return test case tree.
39    */
40   TestTreeNode getTestCasesAsTree();
41
42   /**
43    * Get a list of testing endpoints.
44    */
45   List<RemoteTestingEndpointDefinition> getEndpoints();
46
47
48   /**
49    * For functional testing purposes, allow the endpoint configuration
50    * to be provisioned to the BE.
51    */
52   List<RemoteTestingEndpointDefinition> setEndpoints(List<RemoteTestingEndpointDefinition> endpoints);
53
54   /**
55    * Get a list of scenarios from and endpoint.
56    */
57   List<VtpNameDescriptionPair> getScenarios(String endpoint);
58
59   /**
60    * Get a list of test suites given the endpoint and scenario.
61    */
62   List<VtpNameDescriptionPair> getTestSuites(String endpoint, String scenario);
63
64   /**
65    * Get a list of test cases.
66    * @param endpoint endpoint to contact (e.g. VTP)
67    * @param scenario test scenario to get tests for
68    * @return list of test cases.
69    */
70   List<VtpTestCase> getTestCases(String endpoint, String scenario);
71
72   /**
73    * Get the details about a particular test case.
74    * @param endpoint endpoint to contact (e.g. VTP)
75    * @param scenario test scenario to get tests for
76    * @param testSuite suite to get tests for
77    * @param testCaseName test case name to query.
78    * @return details about the test case.
79    */
80   VtpTestCase getTestCase(String endpoint, String scenario, String testSuite, String testCaseName);
81
82   /**
83    * Execute a collection of tests where the manager must distribute
84    * the tests to the appropriate endpoint and correlate the responses.
85    * @param requests collection of request items.
86    * @param requestId optional request ID provided from client.
87    * @return response from endpoint (don't bother to parse).
88    */
89   List<VtpTestExecutionResponse> execute(List<VtpTestExecutionRequest> requests, String requestId);
90
91   /**
92    * Return a previous results.
93    * @param endpoint endpoint to query
94    * @param executionId execution to query.
95    * @return response from endpoint.
96    */
97   VtpTestExecutionResponse getExecution(String endpoint, String executionId);
98
99 }