You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by bh...@apache.org on 2019/12/10 14:01:58 UTC

[incubator-dlab] branch feature-integration-tests updated: DLAB-000 removed mongo dependency fron DLab

This is an automated email from the ASF dual-hosted git repository.

bhliva pushed a commit to branch feature-integration-tests
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/feature-integration-tests by this push:
     new eb8c033  DLAB-000 removed mongo dependency fron DLab
eb8c033 is described below

commit eb8c0338a2ea5796b5a879ecfc8266e56cb283ea
Author: bhliva <bo...@epam.com>
AuthorDate: Tue Dec 10 16:01:47 2019 +0200

    DLAB-000 removed mongo dependency fron DLab
---
 integration-tests-cucumber/pom.xml                         |  5 -----
 .../src/main/java/org/apache/dlab/mongo/MongoDBHelper.java | 14 --------------
 .../src/test/java/dlab/endpoint/EndpointSteps.java         | 14 +++++++++-----
 .../src/test/resources/config.properties                   | 14 +++++++-------
 .../src/test/resources/dlab/endpoint.feature               | 14 +++++++++-----
 5 files changed, 25 insertions(+), 36 deletions(-)

diff --git a/integration-tests-cucumber/pom.xml b/integration-tests-cucumber/pom.xml
index d96a492..9e32c08 100644
--- a/integration-tests-cucumber/pom.xml
+++ b/integration-tests-cucumber/pom.xml
@@ -35,11 +35,6 @@
             <artifactId>lombok</artifactId>
             <version>1.18.8</version>
         </dependency>
-        <dependency>
-            <groupId>org.mongodb</groupId>
-            <artifactId>mongo-java-driver</artifactId>
-            <version>3.10.2</version>
-        </dependency>
 
 
         <dependency>
diff --git a/integration-tests-cucumber/src/main/java/org/apache/dlab/mongo/MongoDBHelper.java b/integration-tests-cucumber/src/main/java/org/apache/dlab/mongo/MongoDBHelper.java
deleted file mode 100644
index 11e4dea..0000000
--- a/integration-tests-cucumber/src/main/java/org/apache/dlab/mongo/MongoDBHelper.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.apache.dlab.mongo;
-
-import com.mongodb.client.MongoClient;
-import com.mongodb.client.MongoClients;
-import org.apache.dlab.util.PropertyHelper;
-
-public class MongoDBHelper {
-	private static final MongoClient client = MongoClients
-			.create(PropertyHelper.read("mongo.connection.string"));
-
-	public static void cleanCollection(String collection) {
-		client.getDatabase(PropertyHelper.read("mongo.db.name")).getCollection(collection).drop();
-	}
-}
diff --git a/integration-tests-cucumber/src/test/java/dlab/endpoint/EndpointSteps.java b/integration-tests-cucumber/src/test/java/dlab/endpoint/EndpointSteps.java
index 624b1ca..5c2af2a 100644
--- a/integration-tests-cucumber/src/test/java/dlab/endpoint/EndpointSteps.java
+++ b/integration-tests-cucumber/src/test/java/dlab/endpoint/EndpointSteps.java
@@ -9,7 +9,6 @@ import cucumber.api.java.en.Then;
 import cucumber.api.java.en.When;
 import dlab.util.KeycloakUtil;
 import org.apache.dlab.dto.EndpointDTO;
-import org.apache.dlab.mongo.MongoDBHelper;
 import org.apache.dlab.util.JacksonMapper;
 
 import java.net.URI;
@@ -40,10 +39,9 @@ public class EndpointSteps {
 		response = request.post(API_URI + "endpoint");
 	}
 
-	@Given("There is no endpoints in DLab")
-	public void thereIsNoEndpointsInDLab() {
-		MongoDBHelper.cleanCollection("endpoints");
-
+	@Given("There is no endpoint with name {string} in DLab")
+	public void thereIsNoEndpointsInDLab(String name) {
+		removeEndpointWithName(name);
 	}
 
 	@Then("Response status code is {int}")
@@ -90,6 +88,12 @@ public class EndpointSteps {
 		assertThat("test2", equalTo(endpoints[1].getName()));
 	}
 
+	@And("Remove endpoint with name {string}")
+	public void removeEndpointWithName(String name) {
+		final Response response = authenticatedRequest().delete(API_URI + "endpoint/" + name);
+		assertThat(response.getStatusCode(), equalTo(200));
+	}
+
 	private RequestSpecification authenticatedRequest() {
 		return given()
 				.auth()
diff --git a/integration-tests-cucumber/src/test/resources/config.properties b/integration-tests-cucumber/src/test/resources/config.properties
index 49933a9..1f113d9 100644
--- a/integration-tests-cucumber/src/test/resources/config.properties
+++ b/integration-tests-cucumber/src/test/resources/config.properties
@@ -1,7 +1,7 @@
-dlab.api.base.uri=<API_URI>
-mongo.connection.string=<MONGO_CONNECTION_STRING>
-mongo.db.name=<DB_NAME>
-keycloak.serverUrl=<KEYCLOAK_SERVER_URL>
-keycloak.realm=<REALM>
-keycloak.clientId=<KEYCLOAK_CLIENT_ID>
-keycloak.clientSecret=<KEYCLOAK_CLIENT_SECRET>
\ No newline at end of file
+dlab.api.base.uri=http://ec2-44-228-217-167.us-west-2.compute.amazonaws.com/api/
+mongo.connection.string=mongodb://admin:CVZ0vVMaL5@localhost:27018/dlabdb
+mongo.db.name=dlabdb
+keycloak.serverUrl=http://52.11.45.11:8080/auth
+keycloak.realm=dlab
+keycloak.clientId=bhliva1012a-ui
+keycloak.clientSecret=83025cea-4121-42ea-9044-f5539fbe857f
\ No newline at end of file
diff --git a/integration-tests-cucumber/src/test/resources/dlab/endpoint.feature b/integration-tests-cucumber/src/test/resources/dlab/endpoint.feature
index 7281a24..d92de95 100644
--- a/integration-tests-cucumber/src/test/resources/dlab/endpoint.feature
+++ b/integration-tests-cucumber/src/test/resources/dlab/endpoint.feature
@@ -3,11 +3,12 @@ Feature: Endpoint management in DLab
 
   Scenario Outline: Create new endpoint when it does not exist
 
-    Given There is no endpoints in DLab
+    Given There is no endpoint with name "<name>" in DLab
     And User try to create new endpoint with name "<name>" and uri "<uri>" and account "<account>" and "<tag>"
     When User send create new endpoint request
     Then Response status code is 200
     And Endpoint URI is present in location header
+    And Remove endpoint with name "<name>"
     Examples:
       | name          | uri     | account   | tag      |
       | test_endpoint | someuri | 123231312 | some_tag |
@@ -15,12 +16,13 @@ Feature: Endpoint management in DLab
 
   Scenario Outline: Create new endpoint when it exist already
 
-    Given There is no endpoints in DLab
+    Given There is no endpoint with name "<name>" in DLab
     And User try to create new endpoint with name "<name>" and uri "<uri>" and account "<account>" and "<tag>"
     And  User send create new endpoint request
     When User try to create new endpoint with name "<name>" and uri "<uri>" and account "<account>" and "<tag>"
     And User send create new endpoint request
     Then Response status code is 409
+    And Remove endpoint with name "<name>"
     Examples:
       | name          | uri     | account   | tag      |
       | test_endpoint | someuri | 123231312 | some_tag |
@@ -28,12 +30,13 @@ Feature: Endpoint management in DLab
 
   Scenario Outline: Get information for endpoint
 
-    Given There is no endpoints in DLab
+    Given There is no endpoint with name "<name>" in DLab
     And User try to create new endpoint with name "<name>" and uri "<uri>" and account "<account>" and "<tag>"
     And  User send create new endpoint request
     When User try to get information about endpoint with name "<name>"
     Then Response status code is 200
     And Endpoint information is successfully returned with name "<name>", uri "<uri>", account "<account>", and tag "<tag>"
+    And Remove endpoint with name "<name>"
     Examples:
       | name          | uri     | account   | tag      |
       | test_endpoint | someuri | 123231312 | some_tag |
@@ -41,7 +44,8 @@ Feature: Endpoint management in DLab
 
   Scenario: Get list of endpoints
 
-    Given There is no endpoints in DLab
+    Given There is no endpoint with name "test1" in DLab
+    Given There is no endpoint with name "test2" in DLab
     And User try to create new endpoint with name "test1" and uri "someuri1" and account "123" and "customTag1"
     And  User send create new endpoint request
     And User try to create new endpoint with name "test2" and uri "someuri2" and account "1233" and "customTag4"
@@ -52,6 +56,6 @@ Feature: Endpoint management in DLab
 
   Scenario: Get not endpoint that does not exist
 
-    Given There is no endpoints in DLab
+    Given There is no endpoint with name "someName" in DLab
     When User try to get information about endpoint with name "someName"
     Then Response status code is 404


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org