summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api')
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ClientConfiguration.java29
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java18
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/RemoteTestingEndpointDefinition.java46
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java14
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java20
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java8
6 files changed, 100 insertions, 35 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ClientConfiguration.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ClientConfiguration.java
new file mode 100644
index 0000000000..9269e8bf22
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ClientConfiguration.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import lombok.Data;
+
+@Data
+public class ClientConfiguration {
+ /**
+ * Enable/disable state for the feature. Client can use this
+ * to show/hide menu items.
+ */
+ private boolean enabled;
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java
index dc9b09c767..ac2f7fcafa 100644
--- a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java
@@ -25,7 +25,12 @@ public interface ExternalTestingManager {
* Return the configuration of this feature that we want to
* expose to the client. Treated as a JSON blob for flexibility.
*/
- String getConfig();
+ ClientConfiguration getConfig();
+
+ /**
+ * For testing purposes, set the client configuration.
+ */
+ ClientConfiguration setConfig(ClientConfiguration config);
/**
* Build a tree of all test cases for the client including all
@@ -35,9 +40,16 @@ public interface ExternalTestingManager {
TestTreeNode getTestCasesAsTree();
/**
- * Get a list of testing endpoints with name and description.
+ * Get a list of testing endpoints.
+ */
+ List<RemoteTestingEndpointDefinition> getEndpoints();
+
+
+ /**
+ * For functional testing purposes, allow the endpoint configuration
+ * to be provisioned to the BE.
*/
- List<VtpNameDescriptionPair> getEndpoints();
+ List<RemoteTestingEndpointDefinition> setEndpoints(List<RemoteTestingEndpointDefinition> endpoints);
/**
* Get a list of scenarios from and endpoint.
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/RemoteTestingEndpointDefinition.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/RemoteTestingEndpointDefinition.java
new file mode 100644
index 0000000000..0d5c30d593
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/RemoteTestingEndpointDefinition.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.util.regex.Pattern;
+
+@Data
+public class RemoteTestingEndpointDefinition {
+ private boolean enabled;
+ private String title;
+ private String url;
+ private String id;
+ private String apiKey;
+ private String scenarioFilter;
+
+ // a compact way to specify and endpoint to ease docker configuration.
+ @JsonIgnore
+ private String config;
+
+ private Pattern scenarioFilterPattern;
+
+ @JsonIgnore
+ public Pattern getScenarioFilterPattern() {
+ if ((scenarioFilterPattern == null) && (scenarioFilter != null)) {
+ scenarioFilterPattern = Pattern.compile(scenarioFilter);
+ }
+ return scenarioFilterPattern;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java
index 42fa330d33..1b75772476 100644
--- a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java
@@ -47,18 +47,4 @@ public class TestTreeNode extends VtpNameDescriptionPair {
public TestTreeNode(String name, String description) {
super(name, description);
}
-
- public void addTest(VtpTestCase test) {
- if (tests == null) {
- tests = new ArrayList<>();
- }
- tests.add(test);
- }
-
- public void addChild(TestTreeNode child) {
- if (children == null) {
- children = new ArrayList<>();
- }
- children.add(child);
- }
}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java
index 33fa0f4477..3df64a40eb 100644
--- a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java
@@ -26,21 +26,21 @@ public class ExternalTestingException extends RuntimeException {
private static final long serialVersionUID = -4357810130868566088L;
- private final String title;
- private final int code;
+ private final String messageCode;
+ private final int httpStatus;
private final String detail;
- public ExternalTestingException(String title, int code, String detail) {
- super(title);
- this.title = title;
- this.code = code;
+ public ExternalTestingException(String messageCode, int httpStatus, String detail) {
+ super(messageCode);
+ this.messageCode = messageCode;
+ this.httpStatus = httpStatus;
this.detail = detail;
}
- public ExternalTestingException(String title, int code, String detail, Throwable parent) {
- super(title, parent);
- this.title = title;
- this.code = code;
+ public ExternalTestingException(String messageCode, int httpStatus, String detail, Throwable parent) {
+ super(messageCode, parent);
+ this.messageCode = messageCode;
+ this.httpStatus = httpStatus;
this.detail = detail;
}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java
index b10d3079d2..bfa07ecc0c 100644
--- a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java
@@ -98,13 +98,5 @@ public class ExecutionRequestTests {
Assert.assertEquals(2, tree.getChildren().size());
Assert.assertEquals(0, tree.getTests().size());
-
- TestTreeNode manual = new TestTreeNode("root", "Root");
-
- manual.addChild(new TestTreeNode("child", "child"));
- manual.addTest(new VtpTestCase());
- Assert.assertEquals(1, manual.getChildren().size());
- Assert.assertEquals(1, manual.getTests().size());
-
}
}